diff --git a/automatic_updates.services.yml b/automatic_updates.services.yml index 38de671385ec67c3dd96ccb7fd1294b9663032e2..21b97e6d111e1f77eed5292efc408f0a00a84fc3 100644 --- a/automatic_updates.services.yml +++ b/automatic_updates.services.yml @@ -4,7 +4,7 @@ services: arguments: - '@keyvalue.expirable' - '@datetime.time' - - '@automatic_updates.path_locator' + - '@package_manager.path_locator' - '@event_dispatcher' - 24 automatic_updates.updater: @@ -46,7 +46,7 @@ services: automatic_updates.disk_space_validator: class: Drupal\automatic_updates\Validator\DiskSpaceValidator arguments: - - '@automatic_updates.path_locator' + - '@package_manager.path_locator' - '@string_translation' tags: - { name: event_subscriber } @@ -61,7 +61,7 @@ services: automatic_updates.validator.file_system_permissions: class: Drupal\automatic_updates\Validator\WritableFileSystemValidator arguments: - - '@automatic_updates.path_locator' + - '@package_manager.path_locator' - '%app.root%' - '@string_translation' tags: @@ -70,8 +70,3 @@ services: class: Drupal\automatic_updates\Validator\CoreComposerValidator tags: - { name: event_subscriber } - automatic_updates.path_locator: - class: Drupal\automatic_updates\PathLocator - arguments: - - '@config.factory' - - '%app.root%' diff --git a/src/PathLocator.php b/src/PathLocator.php deleted file mode 100644 index 3ba735edadf0106dcf26d01a8d9e2227d35820e5..0000000000000000000000000000000000000000 --- a/src/PathLocator.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -namespace Drupal\automatic_updates; - -use Drupal\package_manager\PathLocator as PackageManagerPathLocator; - -/** - * Computes file system paths that are needed for automatic updates. - */ -class PathLocator extends PackageManagerPathLocator { -} diff --git a/src/Validation/ReadinessValidationManager.php b/src/Validation/ReadinessValidationManager.php index 23ab82eefc1f6a748b34f2af9bb79e7ddc710780..6f2a9bfd22d11d37a8ab008898d823cbc6e96e5e 100644 --- a/src/Validation/ReadinessValidationManager.php +++ b/src/Validation/ReadinessValidationManager.php @@ -4,11 +4,11 @@ namespace Drupal\automatic_updates\Validation; use Drupal\automatic_updates\AutomaticUpdatesEvents; use Drupal\automatic_updates\Event\ReadinessCheckEvent; -use Drupal\automatic_updates\PathLocator; use Drupal\automatic_updates\UpdateRecommender; use Drupal\Component\Datetime\TimeInterface; use Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface; use Drupal\package_manager\ComposerUtility; +use Drupal\package_manager\PathLocator; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** @@ -47,7 +47,7 @@ class ReadinessValidationManager { /** * The path locator service. * - * @var \Drupal\automatic_updates\PathLocator + * @var \Drupal\package_manager\PathLocator */ protected $pathLocator; @@ -58,7 +58,7 @@ class ReadinessValidationManager { * The key/value expirable factory. * @param \Drupal\Component\Datetime\TimeInterface $time * The time service. - * @param \Drupal\automatic_updates\PathLocator $path_locator + * @param \Drupal\package_manager\PathLocator $path_locator * The path locator service. * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher * The event dispatcher service. diff --git a/src/Validator/DiskSpaceValidator.php b/src/Validator/DiskSpaceValidator.php index 3bb25fbee97e1d4b8a96d364b31c6e00d715eae8..9b53192ce013ad0f84a5037ce50bb182d57f0016 100644 --- a/src/Validator/DiskSpaceValidator.php +++ b/src/Validator/DiskSpaceValidator.php @@ -4,12 +4,12 @@ namespace Drupal\automatic_updates\Validator; use Drupal\automatic_updates\AutomaticUpdatesEvents; use Drupal\automatic_updates\Event\UpdateEvent; -use Drupal\automatic_updates\PathLocator; use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\Component\FileSystem\FileSystem; use Drupal\Component\Utility\Bytes; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\package_manager\PathLocator; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -22,14 +22,14 @@ class DiskSpaceValidator implements EventSubscriberInterface { /** * The path locator service. * - * @var \Drupal\automatic_updates\PathLocator + * @var \Drupal\package_manager\PathLocator */ protected $pathLocator; /** * Constructs a DiskSpaceValidator object. * - * @param \Drupal\automatic_updates\PathLocator $path_locator + * @param \Drupal\package_manager\PathLocator $path_locator * The path locator service. * @param \Drupal\Core\StringTranslation\TranslationInterface $translation * The translation service. diff --git a/src/Validator/WritableFileSystemValidator.php b/src/Validator/WritableFileSystemValidator.php index 4b564ace37f2e05a15e85c008c40e117fd227df3..792a78da7b6aa70d12dfc27f9e5ca6ca830f8d3b 100644 --- a/src/Validator/WritableFileSystemValidator.php +++ b/src/Validator/WritableFileSystemValidator.php @@ -4,10 +4,10 @@ namespace Drupal\automatic_updates\Validator; use Drupal\automatic_updates\AutomaticUpdatesEvents; use Drupal\automatic_updates\Event\UpdateEvent; -use Drupal\automatic_updates\PathLocator; use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; +use Drupal\package_manager\PathLocator; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -20,7 +20,7 @@ class WritableFileSystemValidator implements EventSubscriberInterface { /** * The path locator service. * - * @var \Drupal\automatic_updates\PathLocator + * @var \Drupal\package_manager\PathLocator */ protected $pathLocator; @@ -34,7 +34,7 @@ class WritableFileSystemValidator implements EventSubscriberInterface { /** * Constructs a WritableFileSystemValidator object. * - * @param \Drupal\automatic_updates\PathLocator $path_locator + * @param \Drupal\package_manager\PathLocator $path_locator * The path locator service. * @param string $app_root * The Drupal root. diff --git a/tests/src/Functional/FileSystemOperationsTest.php b/tests/src/Functional/FileSystemOperationsTest.php index 1e821229b44d4edf52e32c327b609c9670710ebb..fe42f99893c1303860d518bbfa0a4ead0173c50d 100644 --- a/tests/src/Functional/FileSystemOperationsTest.php +++ b/tests/src/Functional/FileSystemOperationsTest.php @@ -49,7 +49,7 @@ class FileSystemOperationsTest extends AutomaticUpdatesFunctionalTestBase { // active directory, and has a staging area within the site directory for // this test. $drupal_root = $this->getDrupalRoot(); - /** @var \Drupal\automatic_updates\PathLocator|\Prophecy\Prophecy\ObjectProphecy $locator */ + /** @var \Drupal\package_manager\PathLocator|\Prophecy\Prophecy\ObjectProphecy $locator */ $locator = $this->prophesize(PathLocator::class); $locator->getActiveDirectory()->willReturn(__DIR__ . '/../../fixtures/fake-site'); $this->stageDir = implode(DIRECTORY_SEPARATOR, [ diff --git a/tests/src/Kernel/ReadinessValidation/CoreComposerValidatorTest.php b/tests/src/Kernel/ReadinessValidation/CoreComposerValidatorTest.php index b2eb7d816644f8d2d50ca9d5e0b37658d875a839..ceadb6b8c2fce5d35ab1c6607af9f9a3490fd405 100644 --- a/tests/src/Kernel/ReadinessValidation/CoreComposerValidatorTest.php +++ b/tests/src/Kernel/ReadinessValidation/CoreComposerValidatorTest.php @@ -2,9 +2,9 @@ namespace Drupal\Tests\automatic_updates\Kernel\ReadinessValidation; -use Drupal\automatic_updates\PathLocator; use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\Core\DependencyInjection\ContainerBuilder; +use Drupal\package_manager\PathLocator; use Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase; /** @@ -38,7 +38,7 @@ class CoreComposerValidatorTest extends AutomaticUpdatesKernelTestBase { // Point to a valid composer.json with no requirements. $locator = $this->prophesize(PathLocator::class); $locator->getActiveDirectory()->willReturn(__DIR__ . '/../../../fixtures/project_staged_validation/no_core_requirements'); - $this->container->set('automatic_updates.path_locator', $locator->reveal()); + $this->container->set('package_manager.path_locator', $locator->reveal()); $error = ValidationResult::createError([ 'Drupal core does not appear to be required in the project-level composer.json.', diff --git a/tests/src/Kernel/ReadinessValidation/DiskSpaceValidatorTest.php b/tests/src/Kernel/ReadinessValidation/DiskSpaceValidatorTest.php index e821121ac7d05d822187d414b2635189efd7f07e..35753da2b2b88be6062dc584a2f35e05d7f609ed 100644 --- a/tests/src/Kernel/ReadinessValidation/DiskSpaceValidatorTest.php +++ b/tests/src/Kernel/ReadinessValidation/DiskSpaceValidatorTest.php @@ -151,7 +151,7 @@ class DiskSpaceValidatorTest extends AutomaticUpdatesKernelTestBase { * @dataProvider providerDiskSpaceValidation */ public function testDiskSpaceValidation(bool $shared_disk, array $free_space, array $expected_results): void { - $path_locator = $this->prophesize('\Drupal\automatic_updates\PathLocator'); + $path_locator = $this->prophesize('\Drupal\package_manager\PathLocator'); $path_locator->getProjectRoot()->willReturn('root'); $path_locator->getVendorDirectory()->willReturn('vendor'); diff --git a/tests/src/Kernel/ReadinessValidation/WritableFileSystemValidatorTest.php b/tests/src/Kernel/ReadinessValidation/WritableFileSystemValidatorTest.php index f49522a5f3cbb894b0d4f0404235b58fd165d664..a89547df21b4babfb0728430534689563dcf8b5f 100644 --- a/tests/src/Kernel/ReadinessValidation/WritableFileSystemValidatorTest.php +++ b/tests/src/Kernel/ReadinessValidation/WritableFileSystemValidatorTest.php @@ -2,10 +2,10 @@ namespace Drupal\Tests\automatic_updates\Kernel\ReadinessValidation; -use Drupal\automatic_updates\PathLocator; use Drupal\automatic_updates\Validation\ValidationResult; use Drupal\automatic_updates\Validator\WritableFileSystemValidator; use Drupal\Core\DependencyInjection\ContainerBuilder; +use Drupal\package_manager\PathLocator; use Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase; use org\bovigo\vfs\vfsStream; diff --git a/tests/src/Kernel/UpdaterTest.php b/tests/src/Kernel/UpdaterTest.php index ed9eeb51df89f98756f3b9df7e7ea36708f05b52..6b3f47497d1d27a3b60deefc99cc286034f3a4cc 100644 --- a/tests/src/Kernel/UpdaterTest.php +++ b/tests/src/Kernel/UpdaterTest.php @@ -2,7 +2,7 @@ namespace Drupal\Tests\automatic_updates\Kernel; -use Drupal\automatic_updates\PathLocator; +use Drupal\package_manager\PathLocator; /** * @coversDefaultClass \Drupal\automatic_updates\Updater