From 24ef17d1a117a564ca2f84db4d345745703bd4d7 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 | 2 ++ phpstan.neon | 6 ++++-- 4 files changed, 10 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..53244e45 100644 --- a/lib/special_cases.php +++ b/lib/special_cases.php @@ -147,6 +147,8 @@ function apcu_fetch($key) * -1 (no limit). * @param int $count If specified, this variable will be filled with the number of * replacements done. + * @param-out int $count + * * @return string|array|string[] preg_replace returns an array if the * subject parameter is an array, or a string * otherwise. 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