Skip to content

Commit 303c7f8

Browse files
committed
Updates for latest phpstan
1 parent 1bbc34b commit 303c7f8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"require-dev": {
2323
"symfony/phpunit-bridge": "^4.2 || ^5",
24-
"phpstan/phpstan": "^1",
24+
"phpstan/phpstan": "^1.3",
2525
"phpstan/phpstan-strict-rules": "^1.1"
2626
},
2727
"autoload": {

src/Preg.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static function matchAll($pattern, $subject, &$matches = null, $flags = 0
7878
}
7979

8080
$result = preg_match_all($pattern, $subject, $matches, $flags, $offset);
81-
if ($result === false || $result === null) {
81+
if ($result === false) {
8282
throw PcreException::fromFunction('preg_match_all', $pattern);
8383
}
8484

@@ -100,7 +100,7 @@ public static function matchAll($pattern, $subject, &$matches = null, $flags = 0
100100
public static function matchAllWithOffsets($pattern, $subject, &$matches, $flags = 0, $offset = 0)
101101
{
102102
$result = preg_match_all($pattern, $subject, $matches, $flags | PREG_OFFSET_CAPTURE, $offset);
103-
if ($result === false || $result === null) {
103+
if ($result === false) {
104104
throw PcreException::fromFunction('preg_match_all', $pattern);
105105
}
106106

@@ -221,7 +221,6 @@ public static function splitWithOffsets($pattern, $subject, $limit = -1, $flags
221221
throw PcreException::fromFunction('preg_split', $pattern);
222222
}
223223

224-
// @phpstan-ignore-next-line See https://github.com/phpstan/phpstan/issues/6155
225224
return $result;
226225
}
227226

0 commit comments

Comments
 (0)