Skip to content

Commit 93198fa

Browse files
jrfnljaapio
authored andcommitted
Psalm: suppress notice about preg_split $flags
As discussed in the PR: > > Argument 4 of preg_split expects 0|1|2|3|4|5|6|7, parent type int provided (see https://psalm.dev/193) > > I believe this issue is for the `phpDocumentor\Reflection\Utils` class and expects the `pregSplit()` method to apply input validation to the value received for `$flags` before passing it off to the PHP native `preg_split()` function. > > IMO that's taking things a little too far as PHP will handle this internally without errors. > See: https://3v4l.org/NdDRK
1 parent b7f9b17 commit 93198fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

psalm.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,12 @@
5353
<file name="src/Utils.php"/>
5454
</errorLevel>
5555
</InvalidReturnStatement>
56+
57+
<ArgumentTypeCoercion>
58+
<errorLevel type="info">
59+
<!-- PHP handles invalid preg_split flags just fine. -->
60+
<file name="src/Utils.php"/>
61+
</errorLevel>
62+
</ArgumentTypeCoercion>
5663
</issueHandlers>
5764
</psalm>

0 commit comments

Comments
 (0)