From b0fc9aeb5352a47998bdc9ea146fcd0f575fff58 Mon Sep 17 00:00:00 2001 From: smiley Date: Tue, 4 Apr 2023 20:29:57 +0200 Subject: [PATCH] :shower: --- src/Output/QRGdImage.php | 1 + src/Output/QRMarkup.php | 2 ++ src/Output/QRMarkupSVG.php | 2 ++ src/QRCode.php | 6 ++++-- tests/Data/QRMatrixTest.php | 2 ++ tests/Output/QROutputTestAbstract.php | 4 ++-- 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Output/QRGdImage.php b/src/Output/QRGdImage.php index 78a317677..d85881918 100644 --- a/src/Output/QRGdImage.php +++ b/src/Output/QRGdImage.php @@ -167,6 +167,7 @@ class QRGdImage extends QROutputAbstract{ } // set transparency after scaling, otherwise it would be undone + // @see https://www.php.net/manual/en/function.imagecolortransparent.php#77099 $this->setTransparencyColor(); if($this->options->returnResource){ diff --git a/src/Output/QRMarkup.php b/src/Output/QRMarkup.php index b49014b1e..d5038a6bf 100644 --- a/src/Output/QRMarkup.php +++ b/src/Output/QRMarkup.php @@ -21,6 +21,8 @@ abstract class QRMarkup extends QROutputAbstract{ * note: we're not necessarily validating the several values, just checking the general syntax * note: css4 colors are not included * + * @todo: XSS proof + * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value * @inheritDoc */ diff --git a/src/Output/QRMarkupSVG.php b/src/Output/QRMarkupSVG.php index 3c744b1ad..d99164e82 100644 --- a/src/Output/QRMarkupSVG.php +++ b/src/Output/QRMarkupSVG.php @@ -24,6 +24,8 @@ use function array_chunk, implode, is_string, preg_match, sprintf, trim; class QRMarkupSVG extends QRMarkup{ /** + * @todo: XSS proof + * * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill * @inheritDoc */ diff --git a/src/QRCode.php b/src/QRCode.php index 7d7cab339..9f37971e6 100755 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -25,10 +25,10 @@ use function class_exists, class_implements, in_array, mb_convert_encoding, mb_i * Turns a text string into a Model 2 QR Code * * @see https://github.com/kazuhikoarase/qrcode-generator/tree/master/php - * @see http://www.qrcode.com/en/codes/model12.html + * @see https://www.qrcode.com/en/codes/model12.html * @see https://www.swisseduc.ch/informatik/theoretische_informatik/qr_codes/docs/qr_standard.pdf * @see https://en.wikipedia.org/wiki/QR_code - * @see http://www.thonky.com/qr-code-tutorial/ + * @see https://www.thonky.com/qr-code-tutorial/ */ class QRCode{ @@ -179,6 +179,8 @@ class QRCode{ /** * QRCode constructor. + * + * PHP8: accept iterable */ public function __construct(SettingsContainerInterface $options = null){ $this->setOptions(($options ?? new QROptions)); diff --git a/tests/Data/QRMatrixTest.php b/tests/Data/QRMatrixTest.php index e8b19656b..9cabb0c16 100755 --- a/tests/Data/QRMatrixTest.php +++ b/tests/Data/QRMatrixTest.php @@ -234,6 +234,7 @@ final class QRMatrixTest extends TestCase{ $version = $matrix->getVersion(); if($version->getVersionNumber() === 1){ + /** @noinspection PhpUnitTestFailedLineInspection */ $this::markTestSkipped('N/A (Version 1 has no alignment pattern)'); } @@ -294,6 +295,7 @@ final class QRMatrixTest extends TestCase{ public function testSetVersionNumber(QRMatrix $matrix):void{ if($matrix->getVersion()->getVersionNumber() < 7){ + /** @noinspection PhpUnitTestFailedLineInspection */ $this::markTestSkipped('N/A (Version < 7)'); } diff --git a/tests/Output/QROutputTestAbstract.php b/tests/Output/QROutputTestAbstract.php index 2a2332054..5df44c949 100644 --- a/tests/Output/QROutputTestAbstract.php +++ b/tests/Output/QROutputTestAbstract.php @@ -10,9 +10,9 @@ namespace chillerlan\QRCodeTest\Output; +use chillerlan\QRCode\QRCode; use chillerlan\QRCode\QROptions; -use chillerlan\QRCode\Common\MaskPattern; -use chillerlan\QRCode\Data\{Byte, QRData, QRMatrix}; +use chillerlan\QRCode\Data\QRMatrix; use chillerlan\QRCode\Output\{QRCodeOutputException, QROutputInterface}; use PHPUnit\Framework\TestCase;