mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-24 21:17:54 +00:00
:octocat: deprecate parameter $transform of QROutputAbstract::collectModules()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user