Skip to content

Commit

Permalink
[Scoper] Skip Composer\EventDispatcher (#6292)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik authored May 2, 2021
1 parent e7dba6f commit dadb1d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/build_scoped_rector_php70.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
# 1. (a) copy files to $NESTED_DIRECTORY directory Exclude the scoped/nested directories to prevent rsync from copying in a loop
- run: rsync --exclude rector-build-php70 -av * rector-build-php70 --quiet
- run: rm -rf rector-build-php70/packages-tests rector-build-php70/rules-tests rector-build-php70/tests

# 2. downgrade rector
- run: sh build/downgrade-rector-php70.sh rector-build-php70
Expand Down
12 changes: 12 additions & 0 deletions scoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ function (string $filePath, string $prefix, string $content): string {
);
},

function (string $filePath, string $prefix, string $content): string {
if (! Strings::contains($content, $prefix . '\Composer\EventDispatcher')) {
return $content;
}

return Strings::replace(
$content, '
#' . $prefix . '\\\\Composer\\\\EventDispatcher#',
'Composer\EventDispatcher'
);
},

// get version for prefixed version
function (string $filePath, string $prefix, string $content): string {
if (! Strings::endsWith($filePath, 'src/Configuration/Configuration.php')) {
Expand Down

0 comments on commit dadb1d8

Please sign in to comment.