You are here

public function RequireOnPublishValidator::__construct in Require on Publish 8

Constructs a RequireOnPublishValidator object.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack object.

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

File

src/Plugin/Validation/Constraint/RequireOnPublishValidator.php, line 53

Class

RequireOnPublishValidator
Validates the RequireOnPublish constraint.

Namespace

Drupal\require_on_publish\Plugin\Validation\Constraint

Code

public function __construct(ModuleHandlerInterface $module_handler, RequestStack $request_stack, MessengerInterface $messenger) {
  $this->moduleHandler = $module_handler;
  $this->messenger = $messenger;
  $this->request = $request_stack
    ->getCurrentRequest();
}