Bump 'chillerlan/php-qrcode' to 6.0.1

This commit is contained in:
supahgreg 2026-04-16 00:43:05 +00:00
parent 44f717ea95
commit 06d3e6bdae
No known key found for this signature in database
17 changed files with 146 additions and 45 deletions

View File

@ -39,7 +39,7 @@
},
"require": {
"spomky-labs/otphp": "^11.3",
"chillerlan/php-qrcode": "^6.0.0",
"chillerlan/php-qrcode": "^6.0.1",
"mervick/material-design-icons": "4.0.1",
"j4mie/idiorm": "dev-master",
"soundasleep/html2text": "^2.1",

12
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "a4b3247f9f4ac3c1d480caea5166b7b5",
"content-hash": "8a3c74be2e448ae3f78640ce2479a247",
"packages": [
{
"name": "chillerlan/php-qrcode",
"version": "6.0.0",
"version": "6.0.1",
"source": {
"type": "git",
"url": "https://github.com/chillerlan/php-qrcode.git",
"reference": "320e5990312295926a8707a0203bf238062b4331"
"reference": "49006e34bd5328f163e80329e7312f34dceea59b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/320e5990312295926a8707a0203bf238062b4331",
"reference": "320e5990312295926a8707a0203bf238062b4331",
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/49006e34bd5328f163e80329e7312f34dceea59b",
"reference": "49006e34bd5328f163e80329e7312f34dceea59b",
"shasum": ""
},
"require": {
@ -101,7 +101,7 @@
"type": "Ko-Fi"
}
],
"time": "2026-03-14T17:16:36+00:00"
"time": "2026-03-18T21:21:07+00:00"
},
{
"name": "chillerlan/php-settings-container",

View File

@ -84,6 +84,8 @@ final class BitBuffer{
/**
* returns the current buffer length
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "BitBuffer::$length" instead.
*/
public function getLength():int{
return $this->length;
@ -95,6 +97,8 @@ final class BitBuffer{
* to debug: `array_map(fn($v) => sprintf('%08b', $v), $bitBuffer->getBuffer())`
*
* @return int[]
*
* @deprecated 6.0.1 This method will be removed in v7, use the property "BitBuffer::$buffer" instead.
*/
public function getBuffer():array{
return $this->buffer;

View File

@ -108,6 +108,7 @@ final class ECICharset{
/**
* Returns the current character set ID
* @deprecated 6.0.1 This method will be removed. In v7, use the property "ECICharset::$charsetID" instead.
*/
public function getID():int{
return $this->charsetID;

View File

@ -138,7 +138,7 @@ final class EccLevel{
* Q: 0b11
* H: 0b10
*/
private int $eccLevel;
private int $level;
/**
* @param int $eccLevel containing the two bits encoding a QR Code's error correction level
@ -151,7 +151,7 @@ final class EccLevel{
throw new QRCodeException('invalid ECC level');
}
$this->eccLevel = $eccLevel;
$this->level = $eccLevel;
}
/**
@ -163,14 +163,16 @@ final class EccLevel{
self::M => 'M',
self::Q => 'Q',
self::H => 'H',
][$this->eccLevel];
][$this->level];
}
/**
* returns the current ECC level
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "EccLevel::$level" instead.
*/
public function getLevel():int{
return $this->eccLevel;
return $this->level;
}
/**
@ -188,7 +190,7 @@ final class EccLevel{
self::M => 1,
self::Q => 2,
self::H => 3,
][$this->eccLevel];
][$this->level];
}
/**

View File

@ -77,6 +77,8 @@ final class GenericGFPoly{
/**
* @return int[]
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "GenericGFPoly::$coefficients" instead.
*/
public function getCoefficients():array{
return $this->coefficients;

View File

@ -26,16 +26,22 @@ interface LuminanceSourceInterface{
* @return int[] A row-major 2D array of luminance values. Do not use result $length as it may be
* larger than $width * $height bytes on some platforms. Do not modify the contents
* of the result.
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$luminances" instead.
*/
public function getLuminances():array;
/**
* @return int The width of the bitmap.
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$width" instead.
*/
public function getWidth():int;
/**
* @return int The height of the bitmap.
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "LuminanceSourceInterface::$height" instead.
*/
public function getHeight():int;

View File

@ -69,7 +69,7 @@ final class MaskPattern{
/**
* The current mask pattern value (0-7)
*/
private int $maskPattern;
private int $currentPattern;
/**
* MaskPattern constructor.
@ -82,14 +82,16 @@ final class MaskPattern{
throw new QRCodeException('invalid mask pattern');
}
$this->maskPattern = $maskPattern;
$this->currentPattern = $maskPattern;
}
/**
* Returns the current mask pattern
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "MaskPattern::$currentPattern" instead.
*/
public function getPattern():int{
return $this->maskPattern;
return $this->currentPattern;
}
/**
@ -112,7 +114,7 @@ final class MaskPattern{
self::PATTERN_101 => fn(int $x, int $y):bool => (($x * $y) % 6) === 0,
self::PATTERN_110 => fn(int $x, int $y):bool => (($x * $y) % 6) < 3,
self::PATTERN_111 => fn(int $x, int $y):bool => (($x + $y + (($x * $y) % 3)) % 2) === 0,
][$this->maskPattern];
][$this->currentPattern];
}
/**

View File

@ -218,7 +218,7 @@ final class Version{
/**
* QR Code version number
*/
private int $version;
private int $versionNumber;
/**
* Version constructor.
@ -231,35 +231,37 @@ final class Version{
throw new QRCodeException('invalid version given');
}
$this->version = $version;
$this->versionNumber = $version;
}
/**
* returns the current version number as string
*/
public function __toString():string{
return (string)$this->version;
return (string)$this->versionNumber;
}
/**
* returns the current version number
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "Version::$versionNumber" instead.
*/
public function getVersionNumber():int{
return $this->version;
return $this->versionNumber;
}
/**
* the matrix size for the given version
*/
public function getDimension():int{
return (($this->version * 4) + 17);
return (($this->versionNumber * 4) + 17);
}
/**
* the version pattern for the given version
*/
public function getVersionPattern():int|null{
return (self::VERSION_PATTERN[$this->version] ?? null);
return (self::VERSION_PATTERN[$this->versionNumber] ?? null);
}
/**
@ -268,21 +270,21 @@ final class Version{
* @return int[]
*/
public function getAlignmentPattern():array{
return self::ALIGNMENT_PATTERN[$this->version];
return self::ALIGNMENT_PATTERN[$this->versionNumber];
}
/**
* returns ECC block information for the given $version and $eccLevel
*/
public function getRSBlocks(EccLevel $eccLevel):array{
return self::RSBLOCKS[$this->version][$eccLevel->getOrdinal()];
return self::RSBLOCKS[$this->versionNumber][$eccLevel->getOrdinal()];
}
/**
* returns the maximum codewords for the current version
*/
public function getTotalCodewords():int{
return self::TOTAL_CODEWORDS[$this->version];
return self::TOTAL_CODEWORDS[$this->versionNumber];
}
}

View File

@ -87,6 +87,7 @@ final class QRData{
/**
* Returns the current BitBuffer instance
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "QRData::$bitBuffer" instead.
* @codeCoverageIgnore
*/
public function getBitBuffer():BitBuffer{

View File

@ -12,13 +12,20 @@ declare(strict_types=1);
namespace chillerlan\QRCode\Data;
use chillerlan\QRCode\Common\{BitBuffer, EccLevel, MaskPattern, Version};
use function array_fill, array_map, array_reverse, count, intdiv;
use chillerlan\QRCode\QRCodeException;
use function array_fill, array_map, array_reverse, count, intdiv, in_array;
/**
* Holds an array representation of the final QR Code that contains numerical values for later output modifications;
* maps the ECC coded binary data and applies the mask pattern
*
* @see http://www.thonky.com/qr-code-tutorial/format-version-information
*
* @property Version|null $version
* @property EccLevel|null $eccLevel
* @property MaskPattern|null $maskPattern
* @property int $moduleCount
* @property int[][] $matrix
*/
class QRMatrix{
@ -149,6 +156,22 @@ class QRMatrix{
$this->matrix = $this->createMatrix($this->moduleCount, $this::M_NULL);
}
/**
* This magic getter serves as an upgrade path for the deprecated property getter methods,
* which will be removed in v7 in favor of asymmetric visibility (PHP 8.4+).
*
* @throws \chillerlan\QRCode\QRCodeException
* @codeCoverageIgnore
*/
public function __get(string $name):mixed{
if(in_array($name, ['matrix', 'version', 'eccLevel', 'maskPattern', 'moduleCount'], true)){
return $this->{$name};
}
throw new QRCodeException('invalid property access');
}
/**
* Creates a 2-dimensional array (square) of the given $size
*
@ -177,6 +200,8 @@ class QRMatrix{
* Returns the data matrix
*
* @return int[][]
*
* @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$matrix" instead.
*/
public function getMatrix():array{
return $this->matrix;
@ -200,6 +225,8 @@ class QRMatrix{
/**
* Returns the current version number
*
* @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$version" instead.
*/
public function getVersion():Version|null{
return $this->version;
@ -207,6 +234,8 @@ class QRMatrix{
/**
* Returns the current ECC level
*
* @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$eccLevel" instead.
*/
public function getEccLevel():EccLevel|null{
return $this->eccLevel;
@ -214,6 +243,8 @@ class QRMatrix{
/**
* Returns the current mask pattern
*
* @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$maskPattern" instead.
*/
public function getMaskPattern():MaskPattern|null{
return $this->maskPattern;
@ -223,6 +254,8 @@ class QRMatrix{
* Returns the absoulute size of the matrix, including quiet zone (after setting it).
*
* size = version * 4 + 17 [ + 2 * quietzone size]
*
* @deprecated 6.0.1 This method will be removed in v7, use the property "QRMatrix::$moduleCount" instead.
*/
public function getSize():int{
return $this->moduleCount;

View File

@ -38,6 +38,8 @@ final class Detector{
/**
* @return \chillerlan\QRCode\Detector\FinderPattern[]
*
* @deprecated 6.0.1 This method will be removed. In v7, use the property "Detector::$finderPatterns" instead.
*/
public function getFinderPatterns():array{
return $this->finderPatterns;

View File

@ -31,6 +31,9 @@ final class FinderPattern extends ResultPoint{
$this->count = ($count ?? 1);
}
/**
* @deprecated 6.0.1 This method will be removed. In v7, use the property "FinderPattern::$count" instead.
*/
public function getCount():int{
return $this->count;
}

View File

@ -32,14 +32,23 @@ abstract class ResultPoint{
$this->estimatedModuleSize = $estimatedModuleSize;
}
/**
* @deprecated 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$x" instead.
*/
public function getX():float{
return $this->x;
}
/**
* @deprecated 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$y" instead.
*/
public function getY():float{
return $this->y;
}
/**
* @deprecated 6.0.1 This method will be removed. In v7, use the property "ResultPoint::$estimatedModuleSize" instead.
*/
public function getEstimatedModuleSize():float{
return $this->estimatedModuleSize;
}

View File

@ -37,6 +37,13 @@ abstract class QROutputAbstract implements QROutputInterface{
*/
protected int $length;
/**
* The current module scale value (might have been modified)
*
* @see \chillerlan\QRCode\QROptions::$scale
*/
protected int $scale;
/**
* an (optional) array of color values for the several QR matrix parts
*
@ -57,25 +64,50 @@ abstract class QROutputAbstract implements QROutputInterface{
/**
* @see \chillerlan\QRCode\QROptions::$excludeFromConnect
* @var int[]
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->excludeFromConnect` instead.
*/
protected array $excludeFromConnect;
/**
* @see \chillerlan\QRCode\QROptions::$keepAsSquare
* @var int[]
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->keepAsSquare` instead.
*/
protected array $keepAsSquare;
/** @see \chillerlan\QRCode\QROptions::$scale */
protected int $scale;
/** @see \chillerlan\QRCode\QROptions::$connectPaths */
/**
* @see \chillerlan\QRCode\QROptions::$connectPaths
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->connectPaths` instead.
*/
protected bool $connectPaths;
/** @see \chillerlan\QRCode\QROptions::$eol */
/**
* @see \chillerlan\QRCode\QROptions::$eol
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->eol` instead.
*/
protected string $eol;
/** @see \chillerlan\QRCode\QROptions::$drawLightModules */
/**
* @see \chillerlan\QRCode\QROptions::$drawLightModules
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->drawLightModules` instead.
*/
protected bool $drawLightModules;
/** @see \chillerlan\QRCode\QROptions::$drawCircularModules */
/**
* @see \chillerlan\QRCode\QROptions::$drawCircularModules
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->drawCircularModules` instead.
*/
protected bool $drawCircularModules;
/** @see \chillerlan\QRCode\QROptions::$circleRadius */
/**
* @see \chillerlan\QRCode\QROptions::$circleRadius
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->circleRadius` instead.
*/
protected float $circleRadius;
/**
* @deprecated 6.0.1 This property will be removed in v7, use `$this->options->circleRadius * 2` instead.
*/
protected float $circleDiameter;
/**
@ -104,6 +136,8 @@ abstract class QROutputAbstract implements QROutputInterface{
* in long loops for a significant performance increase.
*
* These variables are usually used in the "module" methods and are called up to 31329 times (at version 40).
*
* @deprecated 6.0.1 This method will be removed in v7 without replacement (unnecessary).
*/
protected function copyVars():void{
@ -127,7 +161,7 @@ abstract class QROutputAbstract implements QROutputInterface{
/**
* Sets/updates the matrix dimensions
*
* Call this method if you modify the matrix from within your custom module in case the dimensions have been changed
* Call this method if you modify the matrix from within your custom output class in case the dimensions have been changed
*/
protected function setMatrixDimensions():void{
$this->moduleCount = $this->matrix->getSize();

View File

@ -2,17 +2,17 @@
"packages": [
{
"name": "chillerlan/php-qrcode",
"version": "6.0.0",
"version_normalized": "6.0.0.0",
"version": "6.0.1",
"version_normalized": "6.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/chillerlan/php-qrcode.git",
"reference": "320e5990312295926a8707a0203bf238062b4331"
"reference": "49006e34bd5328f163e80329e7312f34dceea59b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/320e5990312295926a8707a0203bf238062b4331",
"reference": "320e5990312295926a8707a0203bf238062b4331",
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/49006e34bd5328f163e80329e7312f34dceea59b",
"reference": "49006e34bd5328f163e80329e7312f34dceea59b",
"shasum": ""
},
"require": {
@ -40,7 +40,7 @@
"setasign/fpdf": "Required to use the QR FPDF output.",
"simple-icons/simple-icons": "SVG icons that you can use to embed as logos in the QR Code"
},
"time": "2026-03-14T17:16:36+00:00",
"time": "2026-03-18T21:21:07+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {

View File

@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '5755b7af1242c03c1292579f2bb8c74eddc521f5',
'reference' => '44f717ea95904dc79b57efc0d5b64ef3c8d4c606',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -13,16 +13,16 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '5755b7af1242c03c1292579f2bb8c74eddc521f5',
'reference' => '44f717ea95904dc79b57efc0d5b64ef3c8d4c606',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'chillerlan/php-qrcode' => array(
'pretty_version' => '6.0.0',
'version' => '6.0.0.0',
'reference' => '320e5990312295926a8707a0203bf238062b4331',
'pretty_version' => '6.0.1',
'version' => '6.0.1.0',
'reference' => '49006e34bd5328f163e80329e7312f34dceea59b',
'type' => 'library',
'install_path' => __DIR__ . '/../chillerlan/php-qrcode',
'aliases' => array(),