Skip to content

Commit dcf71d6

Browse files
committed
:octocat:
1 parent 9b765ae commit dcf71d6

File tree

5 files changed

+98
-19
lines changed

5 files changed

+98
-19
lines changed

phpstan-baseline.neon

Lines changed: 93 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ parameters:
3939
-
4040
rawMessage: 'Parameter #2 $dataSegments of class chillerlan\QRCode\Data\QRData constructor expects array<chillerlan\QRCode\Data\QRDataModeInterface>, array<int, object> given.'
4141
identifier: argument.type
42-
count: 2
42+
count: 1
43+
path: benchmark/QRDataBenchmark.php
44+
45+
-
46+
rawMessage: 'Property chillerlan\QRCodeBenchmark\QRDataBenchmark::$dataMode (chillerlan\QRCode\Data\QRDataModeInterface) does not accept object.'
47+
identifier: assign.propertyType
48+
count: 1
4349
path: benchmark/QRDataBenchmark.php
4450

4551
-
@@ -91,21 +97,11 @@ parameters:
9197
path: benchmark/parse-result.php
9298

9399
-
94-
rawMessage: '''
95-
Call to deprecated method getUri() of class chillerlan\Authenticator\Authenticator:
96-
5.3.0 The parameter `$omitSettings` will be removed in favor of `AuthenticatorOptions::$omitUriSettings`
97-
in the next major version (6.x)
98-
'''
99-
identifier: method.deprecated
100+
rawMessage: Set hook for non-virtual property chillerlan\Settings\SettingsContainerAbstract@anonymous/examples/authenticator.php:22::$fpdfMeasureUnit does not always assign value to it.
101+
identifier: propertySetHook.noAssign
100102
count: 1
101103
path: examples/authenticator.php
102104

103-
-
104-
rawMessage: 'Property chillerlan\QRCode\QROptions::$eccLevel (int) does not accept string.'
105-
identifier: assign.propertyType
106-
count: 1
107-
path: examples/custom_output.php
108-
109105
-
110106
rawMessage: 'Method QRGdRounded::__construct() has parameter $options with no value type specified in iterable type iterable.'
111107
identifier: missingType.iterableValue
@@ -226,6 +222,12 @@ parameters:
226222
count: 1
227223
path: src/Data/Byte.php
228224

225+
-
226+
rawMessage: Cannot access property $level on chillerlan\QRCode\Common\EccLevel|null.
227+
identifier: property.nonObject
228+
count: 1
229+
path: src/Data/QRMatrix.php
230+
229231
-
230232
rawMessage: 'Parameter #1 $version of class chillerlan\QRCode\Data\ReedSolomonEncoder constructor expects chillerlan\QRCode\Common\Version, chillerlan\QRCode\Common\Version|null given.'
231233
identifier: argument.type
@@ -238,6 +240,24 @@ parameters:
238240
count: 1
239241
path: src/Data/QRMatrix.php
240242

243+
-
244+
rawMessage: Access to an undefined property chillerlan\QRCode\Common\LuminanceSourceInterface::$height.
245+
identifier: property.notFound
246+
count: 1
247+
path: src/Decoder/Binarizer.php
248+
249+
-
250+
rawMessage: Access to an undefined property chillerlan\QRCode\Common\LuminanceSourceInterface::$luminances.
251+
identifier: property.notFound
252+
count: 1
253+
path: src/Decoder/Binarizer.php
254+
255+
-
256+
rawMessage: Access to an undefined property chillerlan\QRCode\Common\LuminanceSourceInterface::$width.
257+
identifier: property.notFound
258+
count: 1
259+
path: src/Decoder/Binarizer.php
260+
241261
-
242262
rawMessage: 'Parameter #1 $maskPattern of method chillerlan\QRCode\Data\QRMatrix::mask() expects chillerlan\QRCode\Common\MaskPattern, chillerlan\QRCode\Common\MaskPattern|null given.'
243263
identifier: argument.type
@@ -262,6 +282,12 @@ parameters:
262282
count: 1
263283
path: src/Decoder/BitMatrix.php
264284

285+
-
286+
rawMessage: Cannot access property $versionNumber on chillerlan\QRCode\Common\Version|null.
287+
identifier: property.nonObject
288+
count: 1
289+
path: src/Decoder/Decoder.php
290+
265291
-
266292
rawMessage: 'Method chillerlan\QRCode\Decoder\Decoder::__construct() has parameter $options with no value type specified in iterable type iterable.'
267293
identifier: missingType.iterableValue
@@ -334,6 +360,12 @@ parameters:
334360
count: 1
335361
path: src/Output/QRInterventionImage.php
336362

363+
-
364+
rawMessage: Cannot access property $currentPattern on chillerlan\QRCode\Common\MaskPattern|null.
365+
identifier: property.nonObject
366+
count: 1
367+
path: src/Output/QRMarkupXML.php
368+
337369
-
338370
rawMessage: 'Method chillerlan\QRCode\Output\QROutputAbstract::__construct() has parameter $options with no value type specified in iterable type iterable.'
339371
identifier: missingType.iterableValue
@@ -346,6 +378,18 @@ parameters:
346378
count: 1
347379
path: src/Output/QROutputAbstract.php
348380

381+
-
382+
rawMessage: Cannot access property $currentPattern on chillerlan\QRCode\Common\MaskPattern|null.
383+
identifier: property.nonObject
384+
count: 1
385+
path: src/Output/QRStringJSON.php
386+
387+
-
388+
rawMessage: Cannot access property $versionNumber on chillerlan\QRCode\Common\Version|null.
389+
identifier: property.nonObject
390+
count: 1
391+
path: src/Output/QRStringJSON.php
392+
349393
-
350394
rawMessage: PHPDoc tag @var with type chillerlan\QRCode\Data\QRDataModeInterface is not subtype of native type 'chillerlan\\QRCode\\Data\\AlphaNum'|'chillerlan\\QRCode\\Data\\Byte'|'chillerlan\\QRCode\\Data\\Hanzi'|'chillerlan\\QRCode\\Data\\Kanji'|'chillerlan\\QRCode\\Data\\Number'.
351395
identifier: varTag.nativeType
@@ -358,12 +402,24 @@ parameters:
358402
count: 1
359403
path: src/QRCode.php
360404

405+
-
406+
rawMessage: Set hook for non-virtual property chillerlan\QRCode\QROptions::$fpdfMeasureUnit does not always assign value to it.
407+
identifier: propertySetHook.noAssign
408+
count: 1
409+
path: src/QROptions.php
410+
361411
-
362412
rawMessage: 'Method chillerlan\QRCodeTest\Common\MaskPatternTest::maskPatternProvider() return type has no value type specified in iterable type array.'
363413
identifier: missingType.iterableValue
364414
count: 1
365415
path: tests/Common/MaskPatternTest.php
366416

417+
-
418+
rawMessage: Cannot access property $currentPattern on chillerlan\QRCode\Common\MaskPattern|null.
419+
identifier: property.nonObject
420+
count: 1
421+
path: tests/Data/DataInterfaceTestAbstract.php
422+
367423
-
368424
rawMessage: 'Method chillerlan\QRCodeTest\Data\DataInterfaceTestAbstract::maxLengthProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn'
369425
identifier: missingType.generics
@@ -406,18 +462,42 @@ parameters:
406462
count: 2
407463
path: tests/Data/KanjiTest.php
408464

465+
-
466+
rawMessage: Cannot access property $versionNumber on chillerlan\QRCode\Common\Version|null.
467+
identifier: property.nonObject
468+
count: 2
469+
path: tests/Data/QRDataTest.php
470+
409471
-
410472
rawMessage: 'Parameter #1 $blob of method chillerlan\QRCode\QRCode::readFromBlob() expects string, GdImage|string given.'
411473
identifier: argument.type
412474
count: 1
413475
path: tests/Data/QRDataTest.php
414476

477+
-
478+
rawMessage: Cannot access property $level on chillerlan\QRCode\Common\EccLevel|null.
479+
identifier: property.nonObject
480+
count: 1
481+
path: tests/Data/QRMatrixTest.php
482+
483+
-
484+
rawMessage: Cannot access property $versionNumber on chillerlan\QRCode\Common\Version|null.
485+
identifier: property.nonObject
486+
count: 4
487+
path: tests/Data/QRMatrixTest.php
488+
415489
-
416490
rawMessage: 'Method chillerlan\QRCodeTest\Data\QRMatrixTest::matrixProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn'
417491
identifier: missingType.generics
418492
count: 1
419493
path: tests/Data/QRMatrixTest.php
420494

495+
-
496+
rawMessage: Cannot access property $versionNumber on chillerlan\QRCode\Common\Version|null.
497+
identifier: property.nonObject
498+
count: 1
499+
path: tests/QRCodeReaderTestAbstract.php
500+
421501
-
422502
rawMessage: 'Method chillerlan\QRCodeTest\QRCodeReaderTestAbstract::dataTestProvider() return type with generic class Generator does not specify its types: TKey, TValue, TSend, TReturn'
423503
identifier: missingType.generics

phpstan.dist.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parameters:
1414
ignoreErrors:
1515
# the only place where these instances *may* be null is in the Decoder\BitMatrix class
1616
- message: "#^Cannot call method [\\w]+\\(\\) on chillerlan\\\\QRCode\\\\Common\\\\EccLevel\\|null\\.$#"
17-
- message: "#^Cannot call method [\\w]+\\(\\) on chillerlan\\\\QRCode\\\\Common\\\\MaskPattern\\|null\\.$#"
17+
# - message: "#^Cannot call method [\\w]+\\(\\) on chillerlan\\\\QRCode\\\\Common\\\\MaskPattern\\|null\\.$#"
1818
- message: "#^Cannot call method [\\w]+\\(\\) on chillerlan\\\\QRCode\\\\Common\\\\Version\\|null\\.$#"
1919

2020

src/Common/LuminanceSourceAbstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ abstract class LuminanceSourceAbstract implements LuminanceSourceInterface{
3232
* Fetches luminance data for the underlying bitmap. Values should be fetched using:
3333
* `int luminance = array[y * width + x] & 0xff`
3434
*
35-
* @return int[] A row-major 2D array of luminance values. Do not use result $length as it may be
36-
* larger than $width * $height bytes on some platforms. Do not modify the contents
37-
* of the result.
35+
* A row-major 2D array of luminance values. Do not use result $length as it may be
36+
* larger than $width * $height bytes on some platforms. Do not modify the contents
37+
* of the result.
3838
*
3939
* @var int[]
4040
*/

src/Output/QRMarkupSVG.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function header():string{
121121
*/
122122
protected function paths():string{
123123
$this->r = $this->options->circleRadius;
124-
$this->d = $this->r * 2;
124+
$this->d = ($this->r * 2);
125125

126126
$paths = $this->collectModules();
127127
$svg = [];

tests/QROptionsTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function setEccLevel():void{
4747
$o = new QROptions(['eccLevel' => EccLevel::H]);
4848

4949
$this::assertSame(EccLevel::H, $o->eccLevel);
50-
/** @phpstan-ignore-next-line */
5150
$o->eccLevel = 'q';
5251

5352
$this::assertSame(EccLevel::Q, $o->eccLevel);

0 commit comments

Comments
 (0)