[Scoper] Patch : void in vendor via scoper-php70 config (#6312)

This commit is contained in:
Abdul Malik Ikhsan 2021-05-03 23:29:06 +07:00 committed by GitHub
parent c183278243
commit 84bf36e984
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,6 +159,18 @@ return [
);
},
function (string $filePath, string $prefix, string $content): string {
if (! Strings::contains($filePath, 'vendor/')) {
return $content;
}
// @see https://regex101.com/r/r3AJFl/1
return Strings::replace(
$content, '#\)\s{0,}:\s{0,}void#',
")"
);
},
// unprefix string classes, as they're string on purpose - they have to be checked in original form, not prefixed
function (string $filePath, string $prefix, string $content): string {
// skip vendor, expect rector packages