From cae3a63e6fa53dd48e38110202088f8e59709c6c Mon Sep 17 00:00:00 2001 From: smiley Date: Thu, 9 Oct 2025 23:10:37 +0200 Subject: [PATCH] :octocat: deprecate parameter $transform of QROutputAbstract::collectModules() --- src/Output/QROutputAbstract.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Output/QROutputAbstract.php b/src/Output/QROutputAbstract.php index a2757ac8c..e1457a04e 100644 --- a/src/Output/QROutputAbstract.php +++ b/src/Output/QROutputAbstract.php @@ -225,6 +225,10 @@ abstract class QROutputAbstract implements QROutputInterface{ * $y - current row * $M_TYPE - field value * $M_TYPE_LAYER - (possibly modified) field value that acts as layer id + * + * @deprecated 5.0.5 The parameter $transform will be removed in the next major version + * in favor of a concrete method QROutputAbstract::moduleTransform() + * @see \chillerlan\QRCode\Output\QROutputAbstract::moduleTransform() */ protected function collectModules(Closure $transform):array{ $paths = []; @@ -258,4 +262,22 @@ abstract class QROutputAbstract implements QROutputInterface{ return $paths; } + /** + * The transform callback for the module collector + * + * $x - current column + * $y - current row + * $M_TYPE - field value + * $M_TYPE_LAYER - (possibly modified) field value that acts as layer id ($paths array key) + * + * This method should return a value suitable for the current output class. + * It must return `null` for an empty value. + * + * @see \chillerlan\QRCode\Output\QROutputAbstract::collectModules() + * @return mixed|null + */ + protected function moduleTransform(int $x, int $y, int $M_TYPE, int $M_TYPE_LAYER){ + return null; + } + }