Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to PHPStan 2 #596

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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