diff --git a/automatic_updates.services.yml b/automatic_updates.services.yml index 5d0fc38d790a6515e2c9aa70e8fe1134c2bdde64..a5e5545c3a647ed120e68dbee0c58b52d3b29439 100644 --- a/automatic_updates.services.yml +++ b/automatic_updates.services.yml @@ -26,7 +26,6 @@ services: - '@event_dispatcher' - '@tempstore.shared' - '@datetime.time' - - '@PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactoryInterface' automatic_updates.cron_updater: class: Drupal\automatic_updates\CronUpdater arguments: @@ -41,7 +40,6 @@ services: - '@event_dispatcher' - '@tempstore.shared' - '@datetime.time' - - '@PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactoryInterface' automatic_updates.staged_projects_validator: class: Drupal\automatic_updates\Validator\StagedProjectsValidator arguments: diff --git a/automatic_updates_extensions/automatic_updates_extensions.services.yml b/automatic_updates_extensions/automatic_updates_extensions.services.yml index 2e4867dab545e638a08fae4c91963d7f01fafeb7..dea4d1ff45b378a6ee3238d76c8373357b9a5dfd 100644 --- a/automatic_updates_extensions/automatic_updates_extensions.services.yml +++ b/automatic_updates_extensions/automatic_updates_extensions.services.yml @@ -11,7 +11,6 @@ services: - '@event_dispatcher' - '@tempstore.shared' - '@datetime.time' - - '@PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactoryInterface' automatic_updates_extensions.validator.target_release: class: Drupal\automatic_updates_extensions\Validator\UpdateReleaseValidator tags: diff --git a/package_manager/src/PackageManagerUninstallValidator.php b/package_manager/src/PackageManagerUninstallValidator.php index 8348ed090d822f848b1165c6328122e64cf9b42c..dd9ab876071ed9f8669e22c0daf1a7c3a437fb44 100644 --- a/package_manager/src/PackageManagerUninstallValidator.php +++ b/package_manager/src/PackageManagerUninstallValidator.php @@ -4,7 +4,6 @@ namespace Drupal\package_manager; use Drupal\Core\Extension\ModuleUninstallValidatorInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; -use PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactoryInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; @@ -29,8 +28,7 @@ class PackageManagerUninstallValidator implements ModuleUninstallValidatorInterf $this->container->get('file_system'), $this->container->get('event_dispatcher'), $this->container->get('tempstore.shared'), - $this->container->get('datetime.time'), - $this->container->get(PathFactoryInterface::class) + $this->container->get('datetime.time') ); if ($stage->isAvailable() || !$stage->isApplying()) { return []; diff --git a/package_manager/src/Stage.php b/package_manager/src/Stage.php index c8194d7ae468fef257da5062cca56b22b87c8593..9c04f552d3e2d6c3eaf1fff2122b0618f960df70 100644 --- a/package_manager/src/Stage.php +++ b/package_manager/src/Stage.php @@ -24,7 +24,7 @@ use Drupal\package_manager\Exception\StageValidationException; use PhpTuf\ComposerStager\Domain\Core\Beginner\BeginnerInterface; use PhpTuf\ComposerStager\Domain\Core\Committer\CommitterInterface; use PhpTuf\ComposerStager\Domain\Core\Stager\StagerInterface; -use PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactoryInterface; +use PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactory; use PhpTuf\ComposerStager\Infrastructure\Value\PathList\PathList; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; @@ -187,10 +187,8 @@ class Stage { * The shared tempstore factory. * @param \Drupal\Component\Datetime\TimeInterface $time * The time service. - * @param \PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactoryInterface $path_factory - * The path factory service. */ - public function __construct(ConfigFactoryInterface $config_factory, PathLocator $path_locator, BeginnerInterface $beginner, StagerInterface $stager, CommitterInterface $committer, FileSystemInterface $file_system, EventDispatcherInterface $event_dispatcher, SharedTempStoreFactory $shared_tempstore, TimeInterface $time, PathFactoryInterface $path_factory) { + public function __construct(ConfigFactoryInterface $config_factory, PathLocator $path_locator, BeginnerInterface $beginner, StagerInterface $stager, CommitterInterface $committer, FileSystemInterface $file_system, EventDispatcherInterface $event_dispatcher, SharedTempStoreFactory $shared_tempstore, TimeInterface $time) { $this->configFactory = $config_factory; $this->pathLocator = $path_locator; $this->beginner = $beginner; @@ -200,7 +198,7 @@ class Stage { $this->eventDispatcher = $event_dispatcher; $this->time = $time; $this->tempStore = $shared_tempstore->get('package_manager_stage'); - $this->pathFactory = $path_factory; + $this->pathFactory = new PathFactory(); } /** diff --git a/package_manager/tests/modules/package_manager_test_api/src/ApiController.php b/package_manager/tests/modules/package_manager_test_api/src/ApiController.php index 2d586cdf6f5ed9f7aee2d34799b245c970d2e792..45eb27f0f8d1091476fcfa98a894a2929391430f 100644 --- a/package_manager/tests/modules/package_manager_test_api/src/ApiController.php +++ b/package_manager/tests/modules/package_manager_test_api/src/ApiController.php @@ -5,7 +5,6 @@ namespace Drupal\package_manager_test_api; use Drupal\Core\Controller\ControllerBase; use Drupal\package_manager\PathLocator; use Drupal\package_manager\Stage; -use PhpTuf\ComposerStager\Infrastructure\Factory\Path\PathFactoryInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -55,8 +54,7 @@ class ApiController extends ControllerBase { $container->get('file_system'), $container->get('event_dispatcher'), $container->get('tempstore.shared'), - $container->get('datetime.time'), - $container->get(PathFactoryInterface::class) + $container->get('datetime.time') ); return new static( $stage, diff --git a/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php b/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php index c42d0bf025688df3b935d0cf85ca7272f3ead6af..7296d19205a94f0453d6fbf4fe7357ae1006c427 100644 --- a/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php +++ b/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php @@ -107,8 +107,7 @@ abstract class PackageManagerKernelTestBase extends KernelTestBase { $this->container->get('file_system'), $this->container->get('event_dispatcher'), $this->container->get('tempstore.shared'), - $this->container->get('datetime.time'), - new TestPathFactory() + $this->container->get('datetime.time') ); } @@ -278,6 +277,7 @@ trait TestStageTrait { parent::__construct(...$arguments); $mirror = new \ReflectionClass(Stage::class); $this->tempStore->set($mirror->getConstant('TEMPSTORE_STAGING_ROOT_KEY'), PackageManagerKernelTestBase::$testStagingRoot); + $this->pathFactory = new TestPathFactory(); } /**