Skip to content

Commit

Permalink
Upgrade to PHPStan 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Nov 12, 2024
1 parent 2507b97 commit a13db4f
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 24 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ vendor: .env docker-compose.yml Dockerfile composer.json

.PHONY: unit
unit: vendor ## run unit tests
$(DOCKER_PHP_EXEC) vendor/bin/phpunit
$(DOCKER_PHP_EXEC) vendor/bin/phpunit $(PHPUNIT_ARGS)

.PHONY: cs
cs: vendor ## verify code style rules
Expand All @@ -32,7 +32,7 @@ cs: vendor ## verify code style rules

.PHONY: static-analysis
static-analysis: vendor ## verify that no static analysis issues were introduced
$(DOCKER_PHP_EXEC) vendor/bin/phpstan
$(DOCKER_PHP_EXEC) vendor/bin/phpstan $(PHPSTAN_ARGS)

.PHONY: bc-check
bc-check: vendor ## check for backwards compatibility breaks
Expand All @@ -43,7 +43,7 @@ bc-check: vendor ## check for backwards compatibility breaks

.PHONY: coverage
coverage: vendor ## generate code coverage reports
$(DOCKER_PHP_EXEC) vendor/bin/infection --show-mutations
$(DOCKER_PHP_EXEC) vendor/bin/infection --show-mutations $(INFECTION_ARGS)

.PHONY: clean
clean:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"infection/infection": "^0.29.8",
"laminas/laminas-diactoros": "^3.5.0",
"laminas/laminas-httphandlerrunner": "^2.11.0",
"phpstan/phpstan": "^1.12.10",
"phpstan/phpstan-phpunit": "^1.4.0",
"phpstan/phpstan": "^2.0.1",
"phpstan/phpstan-phpunit": "^2",
"phpunit/phpunit": "^11.4.3",
"squizlabs/php_codesniffer": "^3.10.3"
},
Expand Down
35 changes: 17 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 50 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@
parameters:
ignoreErrors:
-
message: "#^Class PSR7Sessions\\\\Storageless\\\\Http\\\\ClientFingerprint\\\\SameOriginRequest has an uninitialized readonly property \\$currentRequestFingerprint\\. Assign it in the constructor\\.$#"
message: '#^Class PSR7Sessions\\Storageless\\Http\\ClientFingerprint\\SameOriginRequest has an uninitialized readonly property \$currentRequestFingerprint\. Assign it in the constructor\.$#'
identifier: property.uninitializedReadonly
count: 1
path: src/Storageless/Http/ClientFingerprint/SameOriginRequest.php

-
message: '#^@readonly property PSR7Sessions\\Storageless\\Http\\Configuration\:\:\$clientFingerprintConfiguration is assigned outside of the constructor\.$#'
identifier: property.readOnlyByPhpDocAssignNotInConstructor
count: 1
path: src/Storageless/Http/Configuration.php

-
message: '#^@readonly property PSR7Sessions\\Storageless\\Http\\Configuration\:\:\$clock is assigned outside of the constructor\.$#'
identifier: property.readOnlyByPhpDocAssignNotInConstructor
count: 1
path: src/Storageless/Http/Configuration.php

-
message: '#^@readonly property PSR7Sessions\\Storageless\\Http\\Configuration\:\:\$cookie is assigned outside of the constructor\.$#'
identifier: property.readOnlyByPhpDocAssignNotInConstructor
count: 1
path: src/Storageless/Http/Configuration.php

-
message: '#^@readonly property PSR7Sessions\\Storageless\\Http\\Configuration\:\:\$idleTimeout is assigned outside of the constructor\.$#'
identifier: property.readOnlyByPhpDocAssignNotInConstructor
count: 1
path: src/Storageless/Http/Configuration.php

-
message: '#^@readonly property PSR7Sessions\\Storageless\\Http\\Configuration\:\:\$jwtConfiguration is assigned outside of the constructor\.$#'
identifier: property.readOnlyByPhpDocAssignNotInConstructor
count: 1
path: src/Storageless/Http/Configuration.php

-
message: '#^@readonly property PSR7Sessions\\Storageless\\Http\\Configuration\:\:\$refreshTime is assigned outside of the constructor\.$#'
identifier: property.readOnlyByPhpDocAssignNotInConstructor
count: 1
path: src/Storageless/Http/Configuration.php

-
message: '#^@readonly property PSR7Sessions\\Storageless\\Http\\Configuration\:\:\$sessionAttribute is assigned outside of the constructor\.$#'
identifier: property.readOnlyByPhpDocAssignNotInConstructor
count: 1
path: src/Storageless/Http/Configuration.php

-
message: '#^@readonly property cannot have a default value\.$#'
identifier: property.readOnlyByPhpDocDefaultValue
count: 3
path: src/Storageless/Http/Configuration.php

0 comments on commit a13db4f

Please sign in to comment.