Skip to content

Commit 8c75d8b

Browse files
committed
🚿
1 parent 2b2bda3 commit 8c75d8b

File tree

9 files changed

+15
-12
lines changed

9 files changed

+15
-12
lines changed

src/Decoder/BitMatrix.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ private function unmask():void{
223223

224224
/**
225225
* Prepare the parser for a mirrored operation.
226-
* This flag has effect only on the #readFormatInformation() and the
227-
* #readVersion(). Before proceeding with #readCodewords() the
228-
* #mirror() method should be called.
226+
* This flag has effect only on the readFormatInformation() and the
227+
* readVersion() methods. Before proceeding with readCodewords() the
228+
* mirror() method should be called.
229229
*
230230
* @param bool $mirror Whether to read version and format information mirrored.
231231
*/
@@ -426,6 +426,7 @@ private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFo
426426
* @return \chillerlan\QRCode\Common\Version encapsulating the QR Code's version
427427
* @throws \chillerlan\QRCode\Decoder\QRCodeDecoderException if both version information locations cannot be parsed as
428428
* the valid encoding of version information
429+
* @noinspection DuplicatedCode
429430
*/
430431
private function readVersion():Version{
431432

src/Decoder/GDLuminanceSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct($gdImage, SettingsContainerInterface $options = null
4444
(PHP_MAJOR_VERSION >= 8 && !$gdImage instanceof \GdImage)
4545
|| (PHP_MAJOR_VERSION < 8 && (!is_resource($gdImage) || get_resource_type($gdImage) !== 'gd'))
4646
){
47-
throw new QRCodeDecoderException('Invalid GD image source.');
47+
throw new QRCodeDecoderException('Invalid GD image source.'); // @codeCoverageIgnore
4848
}
4949

5050
parent::__construct(imagesx($gdImage), imagesy($gdImage), $options);

src/Detector/Detector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ private function calculateModuleSizeOneWay(FinderPattern $pattern, FinderPattern
130130
* See #sizeOfBlackWhiteBlackRun(int, int, int, int); computes the total width of
131131
* a finder pattern by looking for a black-white-black run from the center in the direction
132132
* of another po$(another finder pattern center), and in the opposite direction too.
133+
*
134+
* @noinspection DuplicatedCode
133135
*/
134136
private function sizeOfBlackWhiteBlackRunBothWays(float $fromX, float $fromY, float $toX, float $toY):float{
135137
$result = $this->sizeOfBlackWhiteBlackRun((int)$fromX, (int)$fromY, (int)$toX, (int)$toY);
@@ -176,7 +178,7 @@ private function sizeOfBlackWhiteBlackRunBothWays(float $fromX, float $fromY, fl
176178
*/
177179
private function sizeOfBlackWhiteBlackRun(int $fromX, int $fromY, int $toX, int $toY):float{
178180
// Mild variant of Bresenham's algorithm;
179-
// see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm
181+
// @see https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
180182
$steep = abs($toY - $fromY) > abs($toX - $fromX);
181183

182184
if($steep){

src/Detector/GridSampler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function sampleGrid(BitMatrix $image, int $dimension, PerspectiveTransfor
152152
}
153153
}
154154
}
155+
// @codeCoverageIgnoreStart
155156
catch(Throwable $aioobe){//ArrayIndexOutOfBoundsException
156157
// This feels wrong, but, sometimes if the finder patterns are misidentified, the resulting
157158
// transform gets "twisted" such that it maps a straight line of points to a set of points
@@ -162,6 +163,7 @@ public function sampleGrid(BitMatrix $image, int $dimension, PerspectiveTransfor
162163
// catching and wrapping ArrayIndexOutOfBoundsException.
163164
throw new QRCodeDetectorException('ArrayIndexOutOfBoundsException');
164165
}
166+
// @codeCoverageIgnoreEnd
165167

166168
}
167169

src/Detector/PerspectiveTransform.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ private function times(PerspectiveTransform $other):self{
149149
public function transformPoints(array &$xValues, array &$yValues = null):void{
150150
$max = count($xValues);
151151

152+
// @codeCoverageIgnoreStart (unused)
152153
if($yValues !== null){
153154

154155
for($i = 0; $i < $max; $i++){
@@ -161,6 +162,7 @@ public function transformPoints(array &$xValues, array &$yValues = null):void{
161162

162163
return;
163164
}
165+
// @codeCoverageIgnoreEnd
164166

165167
for($i = 0; $i < $max; $i += 2){
166168
$x = $xValues[$i];

src/Output/QRMarkup.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*/
2121
class QRMarkup extends QROutputAbstract{
2222

23-
protected string $defaultMode = QRCode::OUTPUT_MARKUP_SVG;
24-
2523
/**
2624
* @inheritDoc
2725
*/

src/Output/QRString.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
*/
2323
class QRString extends QROutputAbstract{
2424

25-
protected string $defaultMode = QRCode::OUTPUT_STRING_TEXT;
26-
2725
/**
2826
* @inheritDoc
2927
*/

tests/Data/ByteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function stringValidateProvider():array{
3535
* @inheritDoc
3636
*/
3737
public function testInvalidDataException():void{
38-
$this::markTestSkipped('N/A');
38+
$this::markTestSkipped('N/A (binary mode)');
3939
}
4040

4141
}

tests/Output/QRStringJSONTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class QRStringJSONTest extends QRStringTestAbstract{
2424
* @inheritDoc
2525
*/
2626
protected function setUp():void{
27-
// just in case someone's running this on some weird disto that's been compiled without ext-json
27+
// just in case someone's running this on some weird distro that's been compiled without ext-json
2828
if(!extension_loaded('json')){
2929
$this::markTestSkipped('ext-json not loaded');
3030
}
@@ -34,7 +34,7 @@ protected function setUp():void{
3434

3535

3636
public function testSetModuleValues():void{
37-
$this::markTestSkipped('N/A');
37+
$this::markTestSkipped('N/A (JSON test)');
3838
}
3939

4040
}

0 commit comments

Comments
 (0)