Skip to content

Commit

Permalink
PHPStan: enable bleeding edge
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 2, 2024
1 parent eae3d67 commit 24ef17d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions generator/phpstan.neon
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion generator/src/PhpStanFunctions/PhpStanType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
2 changes: 2 additions & 0 deletions lib/special_cases.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
includes:
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
- phar://phpstan.phar/conf/bleedingEdge.neon

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

0 comments on commit 24ef17d

Please sign in to comment.