Loading package_manager/src/Event/StatusCheckEvent.php 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php namespace Drupal\package_manager\Event; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\package_manager\ValidationResult; /** * Event fired to check the status of the system to use Package Manager. * * The event's stage will be set with the type of stage that will perform the * operations. The stage may or may not be currently in use. */ class StatusCheckEvent extends PreOperationStageEvent { /** * Adds warning information to the event. * * @param \Drupal\Core\StringTranslation\TranslatableMarkup[] $messages * One or more warning messages. * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $summary * A summary of warning messages. Required if there is more than one * message, optional otherwise. */ public function addWarning(array $messages, ?TranslatableMarkup $summary = NULL): void { $this->results[] = ValidationResult::createWarning($messages, $summary); } } package_manager/src/Validator/ComposerExecutableValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\package_manager\Event\StatusCheckEvent; use PhpTuf\ComposerStager\Domain\Exception\ExceptionInterface; use PhpTuf\ComposerStager\Domain\Service\ProcessOutputCallback\ProcessOutputCallbackInterface; use PhpTuf\ComposerStager\Domain\Service\ProcessRunner\ComposerRunnerInterface; Loading Loading @@ -126,6 +127,7 @@ final class ComposerExecutableValidator implements PreOperationStageValidatorInt public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading package_manager/src/Validator/ComposerPatchesValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\package_manager\Validator; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\StatusCheckEvent; /** * Validates the configuration of the cweagans/composer-patches plugin. Loading Loading @@ -42,6 +43,7 @@ class ComposerPatchesValidator implements PreOperationStageValidatorInterface { public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading package_manager/src/Validator/ComposerSettingsValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\StatusCheckEvent; /** * Validates certain Composer settings. Loading Loading @@ -53,6 +54,7 @@ final class ComposerSettingsValidator implements PreOperationStageValidatorInter public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading package_manager/src/Validator/DiskSpaceValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Component\FileSystem\FileSystem; use Drupal\Component\Utility\Bytes; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\PathLocator; /** Loading Loading @@ -165,6 +166,7 @@ class DiskSpaceValidator implements PreOperationStageValidatorInterface { public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading Loading
package_manager/src/Event/StatusCheckEvent.php 0 → 100644 +29 −0 Original line number Diff line number Diff line <?php namespace Drupal\package_manager\Event; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\package_manager\ValidationResult; /** * Event fired to check the status of the system to use Package Manager. * * The event's stage will be set with the type of stage that will perform the * operations. The stage may or may not be currently in use. */ class StatusCheckEvent extends PreOperationStageEvent { /** * Adds warning information to the event. * * @param \Drupal\Core\StringTranslation\TranslatableMarkup[] $messages * One or more warning messages. * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $summary * A summary of warning messages. Required if there is more than one * message, optional otherwise. */ public function addWarning(array $messages, ?TranslatableMarkup $summary = NULL): void { $this->results[] = ValidationResult::createWarning($messages, $summary); } }
package_manager/src/Validator/ComposerExecutableValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\package_manager\Event\StatusCheckEvent; use PhpTuf\ComposerStager\Domain\Exception\ExceptionInterface; use PhpTuf\ComposerStager\Domain\Service\ProcessOutputCallback\ProcessOutputCallbackInterface; use PhpTuf\ComposerStager\Domain\Service\ProcessRunner\ComposerRunnerInterface; Loading Loading @@ -126,6 +127,7 @@ final class ComposerExecutableValidator implements PreOperationStageValidatorInt public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading
package_manager/src/Validator/ComposerPatchesValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\package_manager\Validator; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\StatusCheckEvent; /** * Validates the configuration of the cweagans/composer-patches plugin. Loading Loading @@ -42,6 +43,7 @@ class ComposerPatchesValidator implements PreOperationStageValidatorInterface { public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading
package_manager/src/Validator/ComposerSettingsValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\StatusCheckEvent; /** * Validates certain Composer settings. Loading Loading @@ -53,6 +54,7 @@ final class ComposerSettingsValidator implements PreOperationStageValidatorInter public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading
package_manager/src/Validator/DiskSpaceValidator.php +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Component\FileSystem\FileSystem; use Drupal\Component\Utility\Bytes; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\package_manager\Event\StatusCheckEvent; use Drupal\package_manager\PathLocator; /** Loading Loading @@ -165,6 +166,7 @@ class DiskSpaceValidator implements PreOperationStageValidatorInterface { public static function getSubscribedEvents() { return [ PreCreateEvent::class => 'validateStagePreOperation', StatusCheckEvent::class => 'validateStagePreOperation', ]; } Loading