class SettingsValidator

Checks that Drupal's settings are valid for Package Manager.

@internal This is an internal part of Package Manager and may be changed or removed at any time without warning. External code should not interact with this class.

Hierarchy

Expanded class hierarchy of SettingsValidator

File

core/modules/package_manager/src/Validator/SettingsValidator.php, line 23

Namespace

Drupal\package_manager\Validator
View source
final class SettingsValidator implements EventSubscriberInterface {
    use StringTranslationTrait;
    
    /**
     * Checks that Drupal's settings are valid for Package Manager.
     */
    public function validate(PreOperationStageEvent $event) : void {
        if (Settings::get('update_fetch_with_http_fallback')) {
            $event->addError([
                $this->t('The <code>update_fetch_with_http_fallback</code> setting must be disabled.'),
            ]);
        }
    }
    
    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents() : array {
        return [
            PreCreateEvent::class => 'validate',
            PreApplyEvent::class => 'validate',
            StatusCheckEvent::class => 'validate',
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
SettingsValidator::getSubscribedEvents public static function
SettingsValidator::validate public function Checks that Drupal&#039;s settings are valid for Package Manager.
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.