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',
        ];
    }

}

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