File tree Expand file tree Collapse file tree 5 files changed +35
-7
lines changed Expand file tree Collapse file tree 5 files changed +35
-7
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ cs-fix:
2525phpstan :
2626 php vendor/bin/phpstan
2727
28+ .PHONY : phpstan-generate-baseline
29+ phpstan-generate-baseline :
30+ php vendor/bin/phpstan --generate-baseline
31+
2832.PHONY : build-abnfgen
2933build-abnfgen :
3034 ./build-abnfgen.sh
Original file line number Diff line number Diff line change 1+ parameters :
2+ ignoreErrors :
3+ -
4+ message : " #^Method PHPStan\\\\ PhpDocParser\\\\ Ast\\\\ ConstExpr\\\\ QuoteAwareConstExprStringNode\\ :\\ :escapeDoubleQuotedString\\ (\\ ) should return string but returns string\\ |null\\ .$#"
5+ count : 1
6+ path : src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php
7+
8+ -
9+ message : " #^Method PHPStan\\\\ PhpDocParser\\\\ Parser\\\\ StringUnescaper\\ :\\ :parseEscapeSequences\\ (\\ ) should return string but returns string\\ |null\\ .$#"
10+ count : 1
11+ path : src/Parser/StringUnescaper.php
Original file line number Diff line number Diff line change 1+ includes :
2+ - phpstan-baseline.neon
3+
14parameters :
25 paths :
36 - src
47 - tests
5- level : 5
8+ level : 8
69 ignoreErrors :
710 - ' #^Dynamic call to static method PHPUnit\\Framework\\Assert #'
Original file line number Diff line number Diff line change @@ -53,13 +53,13 @@ static function ($matches) {
5353 return self ::REPLACEMENTS [$ str ];
5454 }
5555 if ($ str [0 ] === 'x ' || $ str [0 ] === 'X ' ) {
56- return chr (hexdec (substr ($ str , 1 )));
56+ return chr (( int ) hexdec (substr ($ str , 1 )));
5757 }
5858 if ($ str [0 ] === 'u ' ) {
59- return self ::codePointToUtf8 (hexdec ($ matches [2 ]));
59+ return self ::codePointToUtf8 (( int ) hexdec ($ matches [2 ]));
6060 }
6161
62- return chr (octdec ($ str ));
62+ return chr (( int ) octdec ($ str ));
6363 },
6464 $ str
6565 );
Original file line number Diff line number Diff line change @@ -78,8 +78,12 @@ private function provideFuzzyInputsData(string $startSymbol): Iterator
7878 $ inputsDirectory = sprintf ('%s/fuzzy/%s ' , __DIR__ . '/../../../temp ' , $ startSymbol );
7979
8080 if (is_dir ($ inputsDirectory )) {
81- foreach (glob (sprintf ('%s/*.tst ' , $ inputsDirectory )) as $ file ) {
82- unlink ($ file );
81+ $ glob = glob (sprintf ('%s/*.tst ' , $ inputsDirectory ));
82+
83+ if ($ glob !== false ) {
84+ foreach ($ glob as $ file ) {
85+ unlink ($ file );
86+ }
8387 }
8488
8589 } else {
@@ -100,7 +104,13 @@ private function provideFuzzyInputsData(string $startSymbol): Iterator
100104
101105 $ process ->mustRun ();
102106
103- foreach (glob (sprintf ('%s/*.tst ' , $ inputsDirectory )) as $ file ) {
107+ $ glob = glob (sprintf ('%s/*.tst ' , $ inputsDirectory ));
108+
109+ if ($ glob === false ) {
110+ return ;
111+ }
112+
113+ foreach ($ glob as $ file ) {
104114 $ input = file_get_contents ($ file );
105115 yield [$ input ];
106116 }
You can’t perform that action at this time.
0 commit comments