mirror of https://github.com/rectorphp/rector.git
[Scoper] Remove SmartFileInfo and ContainerConfigurator setup on bootstrap.php (#2253)
* [Scoper] Remove SmartFileInfo and ContainerConfigurator setup on bootstrap.php * add e2e for ContainerConfigurator * add comment * define autoload * define autoload * move to e2e-diff * move to e2e-diff
This commit is contained in:
parent
3135f29362
commit
6baafbc5a6
|
@ -18,6 +18,7 @@ jobs:
|
|||
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1']
|
||||
directory:
|
||||
- 'e2e/attributes'
|
||||
- 'e2e/container-configurator'
|
||||
|
||||
name: End to end test with diff - ${{ matrix.directory }}
|
||||
|
||||
|
|
|
@ -23,19 +23,4 @@ spl_autoload_register(function (string $class): void {
|
|||
$composerAutoloader->loadClass($class);
|
||||
}
|
||||
}
|
||||
|
||||
// aliased by php-scoper, that's why its missing
|
||||
if ($class === 'Symplify\SmartFileSystem\SmartFileInfo') {
|
||||
$filePath = __DIR__ . '/vendor/symplify/smart-file-system/src/SmartFileInfo.php';
|
||||
if (file_exists($filePath)) {
|
||||
require $filePath;
|
||||
}
|
||||
}
|
||||
|
||||
if ($class === 'Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator') {
|
||||
// avoid duplicated autoload bug in Rector demo runner
|
||||
if (class_exists('Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator', false)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Rector\\e2e\\": "src"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Php74\Rector\Property\TypedPropertyRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
/**
|
||||
* This e2e test is to be removed after fully migrated to RectorConfig
|
||||
*/
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$parameters = $containerConfigurator->parameters();
|
||||
$parameters->set(Option::PATHS, [__DIR__ . '/src']);
|
||||
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(TypedPropertyRector::class);
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\e2e;
|
||||
|
||||
class SomeClass
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $property;
|
||||
}
|
Loading…
Reference in New Issue