Skip to content

Commit 4caeeab

Browse files
committed
fix: phpstan
1 parent 7738e04 commit 4caeeab

File tree

6 files changed

+25
-9
lines changed

6 files changed

+25
-9
lines changed

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"laravel/pint": "^1.18",
2424
"pestphp/pest": "^2.36|^3.5",
2525
"pestphp/pest-plugin-type-coverage": "^2.8|^3.2",
26-
"phpstan/phpstan": "^2.0",
26+
"phpstan/phpstan": "^1.10|^2.0",
27+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
2728
"symfony/browser-kit": "^6.4|^7.2",
2829
"symfony/console": "^6.4|^7.2",
2930
"symfony/css-selector": "^6.4|^7.2",
@@ -41,16 +42,18 @@
4142
},
4243
"scripts": {
4344
"analyse": "vendor/bin/phpstan analyse",
45+
"arch": "vendor/bin/pest --group=arch",
4446
"coverage": "vendor/bin/pest --coverage --min=90",
4547
"format": "vendor/bin/pint",
4648
"quality": [
49+
"@arch",
4750
"@format",
4851
"@test",
4952
"@analyse",
5053
"@types",
5154
"@coverage"
5255
],
53-
"test": "vendor/bin/pest",
56+
"test": "vendor/bin/pest --exclude-group=arch",
5457
"types": "vendor/bin/pest --type-coverage --min=100"
5558
},
5659
"bin": [

phpstan-baseline.neon

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Call to an undefined method Pest\\\\PendingCalls\\\\TestCall\\|Pest\\\\Support\\\\HigherOrderTapProxy\\:\\:expect\\(\\)\\.$#"
5-
count: 1
4+
message: '#^Call to an undefined method Pest\\PendingCalls\\TestCall\|Pest\\Support\\HigherOrderTapProxy\:\:expect\(\)\.$#'
5+
identifier: method.notFound
6+
count: 2
67
path: tests/ArchTest.php
78

89
-
9-
message: "#^Access to an undefined property Pest\\\\Mixins\\\\Expectation\\<array\\<string, array\\<string, string\\>\\>\\|null\\>\\:\\:\\$not\\.$#"
10+
message: '#^Access to an undefined property Pest\\Mixins\\Expectation\<array\<string, array\<string, string\>\>\|null\>\:\:\$not\.$#'
11+
identifier: property.notFound
1012
count: 1
1113
path: tests/RetrieveTest.php
1214

1315
-
14-
message: "#^Access to an undefined property Pest\\\\Mixins\\\\Expectation\\<bool\\|string\\|null\\>\\:\\:\\$not\\.$#"
16+
message: '#^Access to an undefined property Pest\\Mixins\\Expectation\<string\|false\|null\>\:\:\$not\.$#'
17+
identifier: property.notFound
1518
count: 1
1619
path: tests/RetrieveTest.php

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
includes:
22
- phpstan-baseline.neon
3+
- phar://phpstan.phar/conf/bleedingEdge.neon
4+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
35

46
parameters:
57
level: 9

src/Retrieve.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function save(mixed $path = '.'): array
116116

117117
$prefix = date('Y-m-d');
118118

119-
$files['json'] = $this->saveJson($path.DIRECTORY_SEPARATOR.$prefix);
119+
$files['json'] = $this->saveJson($path.DIRECTORY_SEPARATOR.$prefix); // @phpstan-ignore-line
120120

121121
return $files;
122122
}

src/RetrieveCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Rechtlogisch\TseId;
46

57
use Symfony\Component\Console\Attribute\AsCommand;

tests/ArchTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

33
test('will not use debugging functions')
4-
->expect(['dd', 'dump', 'ray'])
5-
->not->toBeUsed();
4+
->expect(['dd', 'dump', 'ray', 'var_dump', 'echo', 'print_r'])
5+
->not->toBeUsed()
6+
->group('arch');
7+
8+
test('use strict mode')
9+
->expect('Rechtlogisch\TseId')
10+
->toUseStrictTypes()
11+
->group('arch');

0 commit comments

Comments
 (0)