Skip to content

Commit 3233155

Browse files
committed
RegexArrayShapeMatcher - try to catch the same exception as in IgnoredRegexValidator
1 parent 8232f00 commit 3233155

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"patches/Lookahead.patch"
9191
],
9292
"hoa/compiler": [
93+
"patches/HoaException.patch",
9394
"patches/Rule.patch"
9495
],
9596
"hoa/consistency": [

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

patches/HoaException.patch

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- Exception/Exception.php 2024-06-24 15:17:26
2+
+++ Exception/Exception.php 2024-06-24 15:17:51
3+
@@ -37,7 +37,7 @@
4+
namespace Hoa\Compiler\Exception;
5+
6+
use Hoa\Consistency;
7+
-use Hoa\Exception as HoaException;
8+
+use Hoa\Exception\Exception as HoaException;
9+
10+
/**
11+
* Class \Hoa\Compiler\Exception.

src/Type/Php/RegexArrayShapeMatcher.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\Type\Php;
44

5-
use Hoa\Compiler\Exception\Exception;
65
use Hoa\Compiler\Llk\Llk;
76
use Hoa\Compiler\Llk\Parser;
87
use Hoa\Compiler\Llk\TreeNode;
8+
use Hoa\Exception\Exception;
99
use Hoa\File\Read;
1010
use Nette\Utils\RegexpException;
1111
use Nette\Utils\Strings;
@@ -189,7 +189,7 @@ private function countNonOptionalGroups(string $regex): ?int
189189

190190
try {
191191
$ast = self::$parser->parse($regex);
192-
} catch ( Exception) { // @phpstan-ignore catch.notThrowable
192+
} catch (Exception) {
193193
return null;
194194
}
195195

0 commit comments

Comments
 (0)