From 57fa79d384f9eeb56c4dfddd3c89d0f40b0e84c5 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 28 Nov 2024 08:13:05 +0000 Subject: [PATCH] Use less-old phpstan phpstan 1.5 is very out of date and the API for defining rules is incompatible with the current API. tests are currently failing, but they're failing upstream and they should pass once all the other PRs are merged PHPStan 2.0 was released a few days ago, but other parts of our dependency tree are locked to "1.X", so for now I'm just updating to "most recent 1.X" and we can look at 2.0 after the rest is stable. --- composer.json | 6 +++--- generator/composer.json | 4 ++-- generator/phpstan.neon | 6 +++++- phpstan.neon | 6 +++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 87c11f6c..e34c1173 100644 --- a/composer.json +++ b/composer.json @@ -105,15 +105,15 @@ "php": "^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^1", "thecodingmachine/phpstan-strict-rules": "^1.0", "squizlabs/php_codesniffer": "^3.2", "phpunit/phpunit": "^10" }, "scripts": { "test": "phpunit", - "phpstan": "phpstan analyse lib -c phpstan.neon --level=max --no-progress -vvv", + "phpstan": "phpstan analyse", "cs-fix": "phpcbf", "cs-check": "phpcs" } -} \ No newline at end of file +} diff --git a/generator/composer.json b/generator/composer.json index 49def268..96d40856 100644 --- a/generator/composer.json +++ b/generator/composer.json @@ -19,11 +19,11 @@ "thecodingmachine/phpstan-strict-rules": "^1.0", "squizlabs/php_codesniffer": "^3.2", "php-coveralls/php-coveralls": "^2.1", - "phpstan/phpstan": "^1.5" + "phpstan/phpstan": "^1" }, "scripts": { "test": "vendor/bin/phpunit", - "phpstan": "phpstan analyse src -c phpstan.neon --level=max --no-progress -vvv", + "phpstan": "phpstan analyse", "cs-fix": "phpcbf", "cs-check": "phpcs" } diff --git a/generator/phpstan.neon b/generator/phpstan.neon index bf8cad2d..0dcbf845 100644 --- a/generator/phpstan.neon +++ b/generator/phpstan.neon @@ -1,4 +1,8 @@ parameters: + paths: + - ./src + # The level 9 is the highest level (with check for mixed type) + level: 8 ignoreErrors: includes: - - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon \ No newline at end of file + - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon diff --git a/phpstan.neon b/phpstan.neon index d6b61d51..73518de6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,9 @@ parameters: + paths: + - ./lib + # The level 9 is the highest level (with check for mixed type) + level: 8 ignoreErrors: # A lot of functions are in extensions so it is ok not to find those includes: - - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon \ No newline at end of file + - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon