diff --git a/composer.json b/composer.json index 9b082b3..45f4c24 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,10 @@ "php": ">=8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^9.5.0", - "symfony/phpunit-bridge": "^6.3", - "symfony/var-dumper": "^5.4|^6.0" + "phpstan/phpstan": "^2.1.31", + "phpunit/phpunit": "^9.6.29", + "symfony/phpunit-bridge": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0|^8.0" }, "config": { "preferred-install": "dist", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..231dfe1 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,19 @@ +parameters: + ignoreErrors: + - + message: '#^@readonly property Zenstruck\\Bytes\:\:\$system is assigned outside of the constructor\.$#' + identifier: property.readOnlyByPhpDocAssignNotInConstructor + count: 2 + path: src/Bytes.php + + - + message: '#^@readonly property Zenstruck\\Bytes\:\:\$units is assigned outside of the constructor\.$#' + identifier: property.readOnlyByPhpDocAssignNotInConstructor + count: 2 + path: src/Bytes.php + + - + message: '#^@readonly property cannot have a default value\.$#' + identifier: property.readOnlyByPhpDocDefaultValue + count: 2 + path: src/Bytes.php diff --git a/phpstan.neon b/phpstan.neon index f6c9ddc..b6d062c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,3 +1,6 @@ +includes: + - phpstan-baseline.neon + parameters: level: 8 treatPhpDocTypesAsCertain: false