Skip to content
Snippets Groups Projects
Commit fe2d45b2 authored by Ted Bowman's avatar Ted Bowman Committed by Kunal Sachdev
Browse files

subscribe to preapply

parent dae1b968
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !615. Comments created here will be created in the context of that merge request.
Showing
with 22 additions and 0 deletions
...@@ -7,6 +7,7 @@ namespace Drupal\package_manager\Validator; ...@@ -7,6 +7,7 @@ namespace Drupal\package_manager\Validator;
use Composer\Semver\Semver; use Composer\Semver\Semver;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
...@@ -129,6 +130,7 @@ class ComposerExecutableValidator implements EventSubscriberInterface { ...@@ -129,6 +130,7 @@ class ComposerExecutableValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'validateStagePreOperation', PreCreateEvent::class => 'validateStagePreOperation',
PreApplyEvent::class => 'validateStagePreOperation',
StatusCheckEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation',
]; ];
} }
......
...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator; ...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\package_manager\Event\PreApplyEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
...@@ -52,6 +53,7 @@ final class ComposerJsonExistsValidator implements EventSubscriberInterface { ...@@ -52,6 +53,7 @@ final class ComposerJsonExistsValidator implements EventSubscriberInterface {
// @see \Drupal\package_manager\Validator\EnvironmentSupportValidator // @see \Drupal\package_manager\Validator\EnvironmentSupportValidator
return [ return [
PreCreateEvent::class => ['validateComposerJson', 190], PreCreateEvent::class => ['validateComposerJson', 190],
PreApplyEvent::class => ['validateComposerJson', 190],
StatusCheckEvent::class => ['validateComposerJson', 190], StatusCheckEvent::class => ['validateComposerJson', 190],
]; ];
} }
......
...@@ -5,6 +5,7 @@ declare(strict_types = 1); ...@@ -5,6 +5,7 @@ declare(strict_types = 1);
namespace Drupal\package_manager\Validator; namespace Drupal\package_manager\Validator;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\Event\StatusCheckEvent;
...@@ -46,6 +47,7 @@ class ComposerPatchesValidator implements EventSubscriberInterface { ...@@ -46,6 +47,7 @@ class ComposerPatchesValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'validateStagePreOperation', PreCreateEvent::class => 'validateStagePreOperation',
PreApplyEvent::class => 'validateStagePreOperation',
StatusCheckEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation',
]; ];
} }
......
...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator; ...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\Event\StatusCheckEvent;
...@@ -57,6 +58,7 @@ final class ComposerSettingsValidator implements EventSubscriberInterface { ...@@ -57,6 +58,7 @@ final class ComposerSettingsValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'validateStagePreOperation', PreCreateEvent::class => 'validateStagePreOperation',
PreApplyEvent::class => 'validateStagePreOperation',
StatusCheckEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation',
]; ];
} }
......
...@@ -4,6 +4,7 @@ declare(strict_types = 1); ...@@ -4,6 +4,7 @@ declare(strict_types = 1);
namespace Drupal\package_manager\Validator; namespace Drupal\package_manager\Validator;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\Component\FileSystem\FileSystem; use Drupal\Component\FileSystem\FileSystem;
...@@ -169,6 +170,7 @@ class DiskSpaceValidator implements EventSubscriberInterface { ...@@ -169,6 +170,7 @@ class DiskSpaceValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'validateStagePreOperation', PreCreateEvent::class => 'validateStagePreOperation',
PreApplyEvent::class => 'validateStagePreOperation',
StatusCheckEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation',
]; ];
} }
......
...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator; ...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator;
use Drupal\Core\Link; use Drupal\Core\Link;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\Event\StatusCheckEvent;
...@@ -66,6 +67,7 @@ final class EnvironmentSupportValidator implements EventSubscriberInterface { ...@@ -66,6 +67,7 @@ final class EnvironmentSupportValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => ['validateStagePreOperation', 200], PreCreateEvent::class => ['validateStagePreOperation', 200],
PreApplyEvent::class => ['validateStagePreOperation', 200],
StatusCheckEvent::class => ['validateStagePreOperation', 200], StatusCheckEvent::class => ['validateStagePreOperation', 200],
]; ];
} }
......
...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator; ...@@ -6,6 +6,7 @@ namespace Drupal\package_manager\Validator;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\Event\StatusCheckEvent;
...@@ -77,6 +78,7 @@ final class MultisiteValidator implements EventSubscriberInterface { ...@@ -77,6 +78,7 @@ final class MultisiteValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'validateStagePreOperation', PreCreateEvent::class => 'validateStagePreOperation',
PreApplyEvent::class => 'validateStagePreOperation',
StatusCheckEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation',
]; ];
} }
......
...@@ -7,6 +7,7 @@ namespace Drupal\package_manager\Validator; ...@@ -7,6 +7,7 @@ namespace Drupal\package_manager\Validator;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\Event\StatusCheckEvent;
...@@ -51,6 +52,7 @@ final class SettingsValidator implements EventSubscriberInterface { ...@@ -51,6 +52,7 @@ final class SettingsValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'validateStagePreOperation', PreCreateEvent::class => 'validateStagePreOperation',
PreApplyEvent::class => 'validateStagePreOperation',
StatusCheckEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation',
]; ];
} }
......
...@@ -5,6 +5,7 @@ declare(strict_types = 1); ...@@ -5,6 +5,7 @@ declare(strict_types = 1);
namespace Drupal\package_manager\Validator; namespace Drupal\package_manager\Validator;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
...@@ -99,6 +100,7 @@ class WritableFileSystemValidator implements EventSubscriberInterface { ...@@ -99,6 +100,7 @@ class WritableFileSystemValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'validateStagePreOperation', PreCreateEvent::class => 'validateStagePreOperation',
PreApplyEvent::class => 'validateStagePreOperation',
StatusCheckEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation',
]; ];
} }
......
...@@ -9,6 +9,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; ...@@ -9,6 +9,7 @@ use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\Event\StatusCheckEvent;
...@@ -118,6 +119,7 @@ final class CronServerValidator implements EventSubscriberInterface { ...@@ -118,6 +119,7 @@ final class CronServerValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'checkServer', PreCreateEvent::class => 'checkServer',
PreApplyEvent::class => 'checkServer',
StatusCheckEvent::class => 'checkServer', StatusCheckEvent::class => 'checkServer',
]; ];
} }
......
...@@ -4,6 +4,7 @@ declare(strict_types = 1); ...@@ -4,6 +4,7 @@ declare(strict_types = 1);
namespace Drupal\automatic_updates\Validator; namespace Drupal\automatic_updates\Validator;
use Drupal\package_manager\Event\PreApplyEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\automatic_updates\CronUpdater; use Drupal\automatic_updates\CronUpdater;
use Drupal\automatic_updates\Updater; use Drupal\automatic_updates\Updater;
...@@ -80,6 +81,7 @@ final class XdebugValidator implements EventSubscriberInterface { ...@@ -80,6 +81,7 @@ final class XdebugValidator implements EventSubscriberInterface {
public static function getSubscribedEvents(): array { public static function getSubscribedEvents(): array {
return [ return [
PreCreateEvent::class => 'checkForXdebug', PreCreateEvent::class => 'checkForXdebug',
PreApplyEvent::class => 'checkForXdebug',
StatusCheckEvent::class => 'checkForXdebug', StatusCheckEvent::class => 'checkForXdebug',
]; ];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment