Skip to content

Commit 4be9259

Browse files
authored
Fix isolated finder (#372)
1 parent 51652bd commit 4be9259

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ e2e_030: $(PHPSCOPER) fixtures/set030/vendor
368368
.PHONY: e2e_031
369369
e2e_031: ## Run end-to-end tests for the fixture set 031 — unloaded extension symbol
370370
e2e_031: $(PHPSCOPER)
371-
php bin/php-scoper add-prefix \
371+
php $(PHPSCOPER) add-prefix \
372372
--working-dir=fixtures/set031-extension-symbol \
373373
--output-dir=../../build/set031-extension-symbol \
374374
--force \
@@ -380,7 +380,7 @@ e2e_031: $(PHPSCOPER)
380380
.PHONY: e2e_032
381381
e2e_032: ## Run end-to-end tests for the fixture set 032 — isolated finder
382382
e2e_032: $(PHPSCOPER)
383-
php bin/php-scoper add-prefix \
383+
php $(PHPSCOPER) add-prefix \
384384
--working-dir=fixtures/set032-isolated-finder \
385385
--output-dir=../../build/set032-isolated-finder \
386386
--force \

scoper.inc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,16 @@ static function (string $filePath, string $prefix, string $contents): string {
9696
substr($originalContents, $classPosition)
9797
);
9898
},
99+
static function (string $filePath, string $prefix, string $contents): string {
100+
if ('bin/php-scoper' !== $filePath) {
101+
return $contents;
102+
}
103+
104+
return str_replace(
105+
'\\'.$prefix.'\Isolated\Symfony\Component\Finder\Finder::class',
106+
'\Isolated\Symfony\Component\Finder\Finder::class',
107+
$contents
108+
);
109+
},
99110
],
100111
];

0 commit comments

Comments
 (0)