Skip to content

Commit

Permalink
utils
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Apr 20, 2022
1 parent 71402b5 commit fda8840
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
$rectorConfig->import(__DIR__ . '/../utils/**/config/config.php', null, true);
$containerConfigurator->import(__DIR__ . '/../utils/**/config/config.php', null, true);

$services = $containerConfigurator->services();
$services->defaults()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
declare(strict_types=1);

use Rector\Composer\ValueObject\PackageAndVersion;
use Rector\Core\Configuration\Option;
use Rector\Config\RectorConfig;
use Rector\Core\Configuration\ValueObjectInliner;
use Ssch\TYPO3Rector\ComposerPackages\Rector\AddPackageVersionRector;
use Ssch\TYPO3Rector\ComposerPackages\ValueObject\ExtensionVersion;
use Ssch\TYPO3Rector\ComposerPackages\ValueObject\Typo3Version;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../config/config.php');

$services = $containerConfigurator->services();

$parameters = $containerConfigurator->parameters();
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$rectorConfig->importNames();

$extension = new ExtensionVersion(new PackageAndVersion('foo/bar', '1.0'), [new Typo3Version('9.5.99')]);

$services = $rectorConfig->services();
$services->set(AddPackageVersionRector::class)
->call('setExtension', [ValueObjectInliner::inline($extension)]);
};

0 comments on commit fda8840

Please sign in to comment.