Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Input.php

function Input::validate

Overrides InputInterface::validate

1 call to Input::validate()
Input::__construct in vendor/symfony/console/Input/Input.php

File

vendor/symfony/console/Input/Input.php, line 61

Class

Input
Input is the base class for all concrete Input classes.

Namespace

Symfony\Component\Console\Input

Code

public function validate() : void {
    $definition = $this->definition;
    $givenArguments = $this->arguments;
    $missingArguments = array_filter(array_keys($definition->getArguments()), fn($argument) => !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)
        ->isRequired());
    if (\count($missingArguments) > 0) {
        throw new RuntimeException(\sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments)));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal