diff options
| author | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-09 02:49:56 +0000 |
|---|---|---|
| committer | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-09 03:08:30 +0000 |
| commit | e41d6361221a30ca9d996cde7591111e626b7e1c (patch) | |
| tree | 4572f61f37bbc76192ad60e0940c281483bc03af /vendor/chillerlan | |
| parent | ab0aabf8548c206f3f624de5451a9b6abbde90be (diff) | |
Remove dev dependencies and update the rest.
Diffstat (limited to 'vendor/chillerlan')
7 files changed, 38 insertions, 20 deletions
diff --git a/vendor/chillerlan/php-qrcode/composer.json b/vendor/chillerlan/php-qrcode/composer.json index 10ade251b..84aeba2ea 100644 --- a/vendor/chillerlan/php-qrcode/composer.json +++ b/vendor/chillerlan/php-qrcode/composer.json @@ -54,13 +54,13 @@ "require-dev": { "ext-fileinfo": "*", "chillerlan/php-authenticator": "^4.3.1 || ^5.2.1", - "phan/phan": "^5.4.5", + "phan/phan": "^5.5.1", "phpcompatibility/php-compatibility": "10.x-dev", "phpunit/phpunit": "^9.6", "phpmd/phpmd": "^2.15", "setasign/fpdf": "^1.8.2", - "slevomat/coding-standard": "^8.15", - "squizlabs/php_codesniffer": "^3.11" + "slevomat/coding-standard": "^8.23.0", + "squizlabs/php_codesniffer": "^4.0.0" }, "suggest": { "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.", diff --git a/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php b/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php index 93ef9fc59..6dc60e9fe 100644 --- a/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php +++ b/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php @@ -44,7 +44,7 @@ final class AlphaNum extends QRDataModeAbstract{ * @inheritDoc */ public static function validateString(string $string):bool{ - return (bool)preg_match('/^[A-Z\d %$*+-.:\/]+$/', $string); + return (bool)preg_match('/^[A-Z\d %$*+\-.:\/]+$/', $string); } /** diff --git a/vendor/chillerlan/php-qrcode/src/Data/Hanzi.php b/vendor/chillerlan/php-qrcode/src/Data/Hanzi.php index 2df8ac1c6..61f092db8 100644 --- a/vendor/chillerlan/php-qrcode/src/Data/Hanzi.php +++ b/vendor/chillerlan/php-qrcode/src/Data/Hanzi.php @@ -13,7 +13,7 @@ namespace chillerlan\QRCode\Data; use chillerlan\QRCode\Common\{BitBuffer, Mode}; use Throwable; use function chr, implode, intdiv, is_string, mb_convert_encoding, mb_detect_encoding, - mb_detect_order, mb_internal_encoding, mb_strlen, ord, sprintf, strlen; + mb_internal_encoding, mb_strlen, ord, sprintf, strlen; /** * Hanzi (simplified Chinese) mode, GBT18284-2000: 13-bit double-byte characters from the GB2312/GB18030 character set @@ -67,9 +67,12 @@ final class Hanzi extends QRDataModeAbstract{ * @throws \chillerlan\QRCode\Data\QRCodeDataException */ public static function convertEncoding(string $string):string{ - mb_detect_order([mb_internal_encoding(), 'UTF-8', 'GB2312', 'GB18030', 'CP936', 'EUC-CN', 'HZ']); - $detected = mb_detect_encoding($string, null, true); + $detected = mb_detect_encoding( + $string, + [mb_internal_encoding(), 'UTF-8', 'GB2312', 'GB18030', 'CP936', 'EUC-CN', 'HZ'], + true, + ); if($detected === false){ throw new QRCodeDataException('mb_detect_encoding error'); diff --git a/vendor/chillerlan/php-qrcode/src/Data/Kanji.php b/vendor/chillerlan/php-qrcode/src/Data/Kanji.php index ccde82642..03b6f42de 100644 --- a/vendor/chillerlan/php-qrcode/src/Data/Kanji.php +++ b/vendor/chillerlan/php-qrcode/src/Data/Kanji.php @@ -13,7 +13,7 @@ namespace chillerlan\QRCode\Data; use chillerlan\QRCode\Common\{BitBuffer, Mode}; use Throwable; use function chr, implode, intdiv, is_string, mb_convert_encoding, mb_detect_encoding, - mb_detect_order, mb_internal_encoding, mb_strlen, ord, sprintf, strlen; + mb_internal_encoding, mb_strlen, ord, sprintf, strlen; /** * Kanji mode: 13-bit double-byte characters from the Shift-JIS character set @@ -60,9 +60,7 @@ final class Kanji extends QRDataModeAbstract{ * @throws \chillerlan\QRCode\Data\QRCodeDataException */ public static function convertEncoding(string $string):string{ - mb_detect_order([mb_internal_encoding(), 'UTF-8', 'SJIS', 'SJIS-2004']); - - $detected = mb_detect_encoding($string, null, true); + $detected = mb_detect_encoding($string, [mb_internal_encoding(), 'UTF-8', 'SJIS', 'SJIS-2004'], true); if($detected === false){ throw new QRCodeDataException('mb_detect_encoding error'); diff --git a/vendor/chillerlan/php-qrcode/src/Decoder/Decoder.php b/vendor/chillerlan/php-qrcode/src/Decoder/Decoder.php index 6f369a6df..4549accc7 100644 --- a/vendor/chillerlan/php-qrcode/src/Decoder/Decoder.php +++ b/vendor/chillerlan/php-qrcode/src/Decoder/Decoder.php @@ -29,6 +29,7 @@ final class Decoder{ private ?EccLevel $eccLevel = null; private ?MaskPattern $maskPattern = null; private BitBuffer $bitBuffer; + private Detector $detector; /** * Decodes a QR Code represented as a BitMatrix. @@ -37,7 +38,8 @@ final class Decoder{ * @throws \Throwable|\chillerlan\QRCode\Decoder\QRCodeDecoderException */ public function decode(LuminanceSourceInterface $source):DecoderResult{ - $matrix = (new Detector($source))->detect(); + $this->detector = new Detector($source); + $matrix = $this->detector->detect(); try{ // clone the BitMatrix to avoid errors in case we run into mirroring @@ -148,6 +150,7 @@ final class Decoder{ 'data' => $result, 'version' => $this->version, 'eccLevel' => $this->eccLevel, + 'finderPatterns' => $this->detector->getFinderPatterns(), 'maskPattern' => $this->maskPattern, 'structuredAppendParity' => $parityData, 'structuredAppendSequence' => $symbolSequence, diff --git a/vendor/chillerlan/php-qrcode/src/Decoder/DecoderResult.php b/vendor/chillerlan/php-qrcode/src/Decoder/DecoderResult.php index 13fd24ba8..ef0f245d9 100644 --- a/vendor/chillerlan/php-qrcode/src/Decoder/DecoderResult.php +++ b/vendor/chillerlan/php-qrcode/src/Decoder/DecoderResult.php @@ -20,13 +20,14 @@ use function property_exists; * applies to 2D barcode formats. For now, it contains the raw bytes obtained * as well as a String interpretation of those bytes, if applicable. * - * @property \chillerlan\QRCode\Common\BitBuffer $rawBytes - * @property string $data - * @property \chillerlan\QRCode\Common\Version $version - * @property \chillerlan\QRCode\Common\EccLevel $eccLevel - * @property \chillerlan\QRCode\Common\MaskPattern $maskPattern - * @property int $structuredAppendParity - * @property int $structuredAppendSequence + * @property \chillerlan\QRCode\Common\BitBuffer $rawBytes + * @property string $data + * @property \chillerlan\QRCode\Common\Version $version + * @property \chillerlan\QRCode\Common\EccLevel $eccLevel + * @property \chillerlan\QRCode\Common\MaskPattern $maskPattern + * @property int $structuredAppendParity + * @property int $structuredAppendSequence + * @property \chillerlan\QRCode\Detector\FinderPattern[] $finderPatterns */ final class DecoderResult{ @@ -37,6 +38,8 @@ final class DecoderResult{ private string $data = ''; private int $structuredAppendParity = -1; private int $structuredAppendSequence = -1; + /** @var \chillerlan\QRCode\Detector\FinderPattern[] */ + private array $finderPatterns = []; /** * DecoderResult constructor. diff --git a/vendor/chillerlan/php-qrcode/src/Detector/Detector.php b/vendor/chillerlan/php-qrcode/src/Detector/Detector.php index 123b685c6..e173d8b6c 100644 --- a/vendor/chillerlan/php-qrcode/src/Detector/Detector.php +++ b/vendor/chillerlan/php-qrcode/src/Detector/Detector.php @@ -25,6 +25,8 @@ use const NAN; final class Detector{ private BitMatrix $matrix; + /** @var \chillerlan\QRCode\Detector\FinderPattern[] */ + private array $finderPatterns = []; /** * Detector constructor. @@ -34,10 +36,19 @@ final class Detector{ } /** + * @return \chillerlan\QRCode\Detector\FinderPattern[] + */ + public function getFinderPatterns():array{ + return $this->finderPatterns; + } + + /** * Detects a QR Code in an image. */ public function detect():BitMatrix{ - [$bottomLeft, $topLeft, $topRight] = (new FinderPatternFinder($this->matrix))->find(); + $this->finderPatterns = (new FinderPatternFinder($this->matrix))->find(); + + [$bottomLeft, $topLeft, $topRight] = $this->finderPatterns; $moduleSize = $this->calculateModuleSize($topLeft, $topRight, $bottomLeft); $dimension = $this->computeDimension($topLeft, $topRight, $bottomLeft, $moduleSize); |