You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to prefix Infection application but faced an issue with PSR-0 dependency which is not correctly resolved.
I've created a github repo with reproducible issue - just a very small application with only 1 dependency - Pimple container which uses PSR-0 in its composer.json.
How to reproduce:
git clone https://github.com/borNfreee/php-scoper-bug
cd php-scoper-bug
composer install
# check it works
php src/main.php // prints "Hello"# run PHP-Scoper
php-scoper add-prefix --output-dir=build-prefixed --force --prefix=Mutant
composer dump-autoload --working-dir=build-prefixed/ --classmap-authoritative --no-dev
# Then try to run prefixed application:cd build-prefixed
php src/main.php
This throws an error:
PHPFatal error: UncaughtError: Class'Mutant\Pimple\Container' not found in php-scoper-bug/build-prefixed/src/Application.php:10Stack trace: ...
Please note that composer create autoload_static.php with the following content for PSR-0 dependencies:
public static $prefixesPsr0 = array (
'P' =>
array (
'Pimple' => // <------- this is not prefixed
array (
0 => __DIR__ . '/..' . '/pimple/pimple/src',
),
),
);
I don't know what the fix exactly is because I couldn't check it yet. You have a link to the problematic code in my previous comment and the related test here so it should be relatively simple to do.
I'm trying to prefix Infection application but faced an issue with PSR-0 dependency which is not correctly resolved.
I've created a github repo with reproducible issue - just a very small application with only 1 dependency - Pimple container which uses PSR-0 in its
composer.json
.How to reproduce:
This throws an error:
Please note that composer create
autoload_static.php
with the following content for PSR-0 dependencies:while PSR-4 dependencies are prefixed:
Did I miss something?
Hope this helps!
The text was updated successfully, but these errors were encountered: