Skip to content

Commit 8d1539b

Browse files
committed
Remove phpstan baseline, closes #12
1 parent 6693099 commit 8d1539b

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 27 deletions
This file was deleted.

phpstan.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ parameters:
44
- src
55
- tests
66

7-
reportUnmatchedIgnoredErrors: false
87
treatPhpDocTypesAsCertain: false
98

109
bootstrapFiles:
1110
- tests/phpstan-locate-phpunit-autoloader.php
1211

1312
includes:
1413
- vendor/phpstan/phpstan-strict-rules/rules.neon
15-
- phpstan-baseline.neon

src/Preg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static function matchAll(string $pattern, string $subject, ?array &$match
7575
}
7676

7777
$result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset);
78-
if ($result === false || /* PHP < 8 may return null */ $result === null) {
78+
if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false
7979
throw PcreException::fromFunction('preg_match_all', $pattern);
8080
}
8181

@@ -95,7 +95,7 @@ public static function matchAll(string $pattern, string $subject, ?array &$match
9595
public static function matchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int
9696
{
9797
$result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL | PREG_OFFSET_CAPTURE, $offset);
98-
if ($result === false || /* PHP < 8 may return null */ $result === null) {
98+
if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false
9999
throw PcreException::fromFunction('preg_match_all', $pattern);
100100
}
101101

0 commit comments

Comments
 (0)