Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit e6cec62

Browse files
committed
Improve PHPStan ignore rules
1 parent a832ec3 commit e6cec62

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

phpstan.neon

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ parameters:
55
paths: [src, test/src, test/suite]
66
inferPrivatePropertyTypeFromConstructor: true
77
ignoreErrors:
8-
- /^Function describe not found.$/
9-
- /^Function expect not found.$/
10-
- /^Function it not found.$/
8+
- message: /^Function describe not found\.$/
9+
paths: [test/*]
10+
- message: /^Function expect not found\.$/
11+
paths: [test/*]
12+
- message: /^Function it not found\.$/
13+
paths: [test/*]

test/phpstan.neon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ parameters:
55
- %rootDir%/../../../kahlan-config.php
66

77
ignoreErrors:
8-
- /^Function describe not found.$/
9-
- /^Function expect not found.$/
10-
- /^Function it not found.$/
8+
- /^Function describe not found\.$/
9+
- /^Function expect not found\.$/
10+
- /^Function it not found\.$/

test/src/TestAnalyser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ private static function escapeArguments(string ...$arguments): array
4141
}
4242

4343
/**
44-
* @var string
44+
* @var string|null
4545
*/
4646
private static $root;
4747

4848
/**
49-
* @var array<string>
49+
* @var array<string>|null
5050
*/
5151
private static $arguments;
5252
}

test/src/functions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ function acceptSerializable(Serializable $serializable): void {}
1919
function safeGlob(): array {
2020
$result = call_user_func_array('glob', func_get_args());
2121

22+
if (!is_array($result)) {
23+
throw new RuntimeException('Unexpected glob() result');
24+
}
25+
2226
if (!$result) {
2327
throw new RuntimeException('No paths found');
2428
}

0 commit comments

Comments
 (0)