Skip to content

Commit a6be982

Browse files
committed
Get rid of JetBrains PhpStorm attributes in nette/utils
Because the PHP-Scoper collapses the code to a single line, it breaks the signature on PHP < 8.0 because it "comments" the rest of the line
1 parent 154d672 commit a6be982

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/build/scoper.inc.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,16 @@ function (string $filePath, string $prefix, string $content): string {
218218

219219
return str_replace(sprintf('use %s\\PhpParser;', $prefix), 'use PhpParser;', $content);
220220
},
221+
function (string $filePath, string $prefix, string $content): string {
222+
if (
223+
$filePath !== 'vendor/nette/utils/src/Utils/Strings.php'
224+
&& $filePath !== 'vendor/nette/utils/src/Utils/Arrays.php'
225+
) {
226+
return $content;
227+
}
228+
229+
return str_replace('#[\\JetBrains\\PhpStorm\\Language(\'RegExp\')] ', '', $content);
230+
},
221231
],
222232
'exclude-namespaces' => [
223233
'PHPStan',

0 commit comments

Comments
 (0)