diff --git a/src/Decoder/BitMatrix.php b/src/Decoder/BitMatrix.php index 66f708507..fa23633fe 100644 --- a/src/Decoder/BitMatrix.php +++ b/src/Decoder/BitMatrix.php @@ -223,9 +223,9 @@ final class BitMatrix{ /** * Prepare the parser for a mirrored operation. - * This flag has effect only on the #readFormatInformation() and the - * #readVersion(). Before proceeding with #readCodewords() the - * #mirror() method should be called. + * This flag has effect only on the readFormatInformation() and the + * readVersion() methods. Before proceeding with readCodewords() the + * mirror() method should be called. * * @param bool $mirror Whether to read version and format information mirrored. */ @@ -426,6 +426,7 @@ final class BitMatrix{ * @return \chillerlan\QRCode\Common\Version encapsulating the QR Code's version * @throws \chillerlan\QRCode\Decoder\QRCodeDecoderException if both version information locations cannot be parsed as * the valid encoding of version information + * @noinspection DuplicatedCode */ private function readVersion():Version{ diff --git a/src/Decoder/GDLuminanceSource.php b/src/Decoder/GDLuminanceSource.php index 0e367fa69..b1df2bd68 100644 --- a/src/Decoder/GDLuminanceSource.php +++ b/src/Decoder/GDLuminanceSource.php @@ -44,7 +44,7 @@ class GDLuminanceSource extends LuminanceSourceAbstract{ (PHP_MAJOR_VERSION >= 8 && !$gdImage instanceof \GdImage) || (PHP_MAJOR_VERSION < 8 && (!is_resource($gdImage) || get_resource_type($gdImage) !== 'gd')) ){ - throw new QRCodeDecoderException('Invalid GD image source.'); + throw new QRCodeDecoderException('Invalid GD image source.'); // @codeCoverageIgnore } parent::__construct(imagesx($gdImage), imagesy($gdImage), $options); diff --git a/src/Detector/Detector.php b/src/Detector/Detector.php index a9279f8b9..78694476f 100644 --- a/src/Detector/Detector.php +++ b/src/Detector/Detector.php @@ -130,6 +130,8 @@ final class Detector{ * See #sizeOfBlackWhiteBlackRun(int, int, int, int); computes the total width of * a finder pattern by looking for a black-white-black run from the center in the direction * of another po$(another finder pattern center), and in the opposite direction too. + * + * @noinspection DuplicatedCode */ private function sizeOfBlackWhiteBlackRunBothWays(float $fromX, float $fromY, float $toX, float $toY):float{ $result = $this->sizeOfBlackWhiteBlackRun((int)$fromX, (int)$fromY, (int)$toX, (int)$toY); @@ -176,7 +178,7 @@ final class Detector{ */ private function sizeOfBlackWhiteBlackRun(int $fromX, int $fromY, int $toX, int $toY):float{ // Mild variant of Bresenham's algorithm; - // see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm + // @see https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm $steep = abs($toY - $fromY) > abs($toX - $fromX); if($steep){ diff --git a/src/Detector/GridSampler.php b/src/Detector/GridSampler.php index 27ae45098..ebcf03be3 100644 --- a/src/Detector/GridSampler.php +++ b/src/Detector/GridSampler.php @@ -152,6 +152,7 @@ final class GridSampler{ } } } + // @codeCoverageIgnoreStart catch(Throwable $aioobe){//ArrayIndexOutOfBoundsException // This feels wrong, but, sometimes if the finder patterns are misidentified, the resulting // transform gets "twisted" such that it maps a straight line of points to a set of points @@ -162,6 +163,7 @@ final class GridSampler{ // catching and wrapping ArrayIndexOutOfBoundsException. throw new QRCodeDetectorException('ArrayIndexOutOfBoundsException'); } + // @codeCoverageIgnoreEnd } diff --git a/src/Detector/PerspectiveTransform.php b/src/Detector/PerspectiveTransform.php index e7a137b0c..96a07ff9f 100644 --- a/src/Detector/PerspectiveTransform.php +++ b/src/Detector/PerspectiveTransform.php @@ -149,6 +149,7 @@ final class PerspectiveTransform{ public function transformPoints(array &$xValues, array &$yValues = null):void{ $max = count($xValues); + // @codeCoverageIgnoreStart (unused) if($yValues !== null){ for($i = 0; $i < $max; $i++){ @@ -161,6 +162,7 @@ final class PerspectiveTransform{ return; } + // @codeCoverageIgnoreEnd for($i = 0; $i < $max; $i += 2){ $x = $xValues[$i]; diff --git a/src/Output/QRMarkup.php b/src/Output/QRMarkup.php index 598ff5571..516b48e7b 100644 --- a/src/Output/QRMarkup.php +++ b/src/Output/QRMarkup.php @@ -20,8 +20,6 @@ use function implode, is_string, ksort, sprintf, strip_tags, trim; */ class QRMarkup extends QROutputAbstract{ - protected string $defaultMode = QRCode::OUTPUT_MARKUP_SVG; - /** * @inheritDoc */ diff --git a/src/Output/QRString.php b/src/Output/QRString.php index 35cb24028..0732bcc7d 100644 --- a/src/Output/QRString.php +++ b/src/Output/QRString.php @@ -22,8 +22,6 @@ use function implode, is_string, json_encode; */ class QRString extends QROutputAbstract{ - protected string $defaultMode = QRCode::OUTPUT_STRING_TEXT; - /** * @inheritDoc */ diff --git a/tests/Data/ByteTest.php b/tests/Data/ByteTest.php index 5b6e336c2..58454fe87 100644 --- a/tests/Data/ByteTest.php +++ b/tests/Data/ByteTest.php @@ -35,7 +35,7 @@ final class ByteTest extends DatainterfaceTestAbstract{ * @inheritDoc */ public function testInvalidDataException():void{ - $this::markTestSkipped('N/A'); + $this::markTestSkipped('N/A (binary mode)'); } } diff --git a/tests/Output/QRStringJSONTest.php b/tests/Output/QRStringJSONTest.php index 8ba71c1e9..ccc3b9fa0 100644 --- a/tests/Output/QRStringJSONTest.php +++ b/tests/Output/QRStringJSONTest.php @@ -24,7 +24,7 @@ final class QRStringJSONTest extends QRStringTestAbstract{ * @inheritDoc */ protected function setUp():void{ - // just in case someone's running this on some weird disto that's been compiled without ext-json + // just in case someone's running this on some weird distro that's been compiled without ext-json if(!extension_loaded('json')){ $this::markTestSkipped('ext-json not loaded'); } @@ -34,7 +34,7 @@ final class QRStringJSONTest extends QRStringTestAbstract{ public function testSetModuleValues():void{ - $this::markTestSkipped('N/A'); + $this::markTestSkipped('N/A (JSON test)'); } }