From 97c73beed7e885d66c2fc6d760189f916211d1a3 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 2 Dec 2024 21:16:18 +0100 Subject: [PATCH] PHPStan: enable bleeding edge --- generator/phpstan.neon | 6 ++++-- generator/src/PhpStanFunctions/PhpStanType.php | 1 - lib/special_cases.php | 1 + phpstan.neon | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/generator/phpstan.neon b/generator/phpstan.neon index 0dcbf845..7e13935f 100644 --- a/generator/phpstan.neon +++ b/generator/phpstan.neon @@ -1,8 +1,10 @@ +includes: + - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon + - phar://phpstan.phar/conf/bleedingEdge.neon + 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 diff --git a/generator/src/PhpStanFunctions/PhpStanType.php b/generator/src/PhpStanFunctions/PhpStanType.php index 401ca8ec..dfe8b0b2 100644 --- a/generator/src/PhpStanFunctions/PhpStanType.php +++ b/generator/src/PhpStanFunctions/PhpStanType.php @@ -56,7 +56,6 @@ public function __construct(string $data, bool $writeOnly = false) $falsable = true; \array_splice($returnTypes, (int) $falsablePosition, 1); } - /** @var int $count */ $count = \count($returnTypes); if ($count === 0) { $returnType = ''; diff --git a/lib/special_cases.php b/lib/special_cases.php index 71159d8f..e6f2707b 100644 --- a/lib/special_cases.php +++ b/lib/special_cases.php @@ -29,6 +29,7 @@ * into associative arrays. * @param int<1, max> $depth User specified recursion depth. * @param int $flags Bitmask of JSON decode options. + * @param-out int $flags * * @return mixed * @throws JsonException if the JSON cannot be decoded. diff --git a/phpstan.neon b/phpstan.neon index 73518de6..7259e86f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,3 +1,7 @@ +includes: + - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon + - phar://phpstan.phar/conf/bleedingEdge.neon + parameters: paths: - ./lib @@ -5,5 +9,3 @@ parameters: 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