Skip to content

Commit

Permalink
Increase PHPStan rule level to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 17, 2024
1 parent 1d4d9a9 commit f04804d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
parameters:
level: 9
level: 10
paths:
- src
8 changes: 6 additions & 2 deletions src/CodeUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace SebastianBergmann\CodeUnit;

use function assert;
use function count;
use function file;
use function file_exists;
Expand Down Expand Up @@ -98,13 +99,16 @@ public static function forFileWithAbsolutePath(string $path): FileUnit
{
self::ensureFileExistsAndIsReadable($path);

$lines = file($path);

assert($lines !== false);

return new FileUnit(
$path,
$path,
range(
1,
// @phpstan-ignore argument.type
count(file($path)),
count($lines),
),
);
}
Expand Down

0 comments on commit f04804d

Please sign in to comment.