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

Breadcrumb

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

class MissingMandatoryParametersException

Exception thrown when a route cannot be generated because of missing mandatory parameters.

@author Alexandre Salomé <alexandre.salome@gmail.com>

Hierarchy

  • class \Symfony\Component\Routing\Exception\InvalidArgumentException extends \Symfony\Component\Routing\Exception\InvalidArgumentException implements \Symfony\Component\Routing\Exception\ExceptionInterface
    • class \Symfony\Component\Routing\Exception\InvalidArgumentException extends \Symfony\Component\Routing\Exception\InvalidArgumentException implements \Symfony\Component\Routing\Exception\ExceptionInterface
      • class \Symfony\Component\Routing\Exception\MissingMandatoryParametersException extends \Symfony\Component\Routing\Exception\InvalidArgumentException implements \Symfony\Component\Routing\Exception\ExceptionInterface

Expanded class hierarchy of MissingMandatoryParametersException

6 files declare their use of MissingMandatoryParametersException
EntityBase.php in core/lib/Drupal/Core/Entity/EntityBase.php
HelpTwigExtension.php in core/modules/help/src/HelpTwigExtension.php
LinkNotExistingInternalConstraintValidator.php in core/modules/link/src/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidator.php
UrlGenerator.php in vendor/symfony/routing/Generator/UrlGenerator.php
UrlGenerator.php in core/lib/Drupal/Core/Routing/UrlGenerator.php

... See full list

File

vendor/symfony/routing/Exception/MissingMandatoryParametersException.php, line 20

Namespace

Symfony\Component\Routing\Exception
View source
class MissingMandatoryParametersException extends \InvalidArgumentException implements ExceptionInterface {
    private string $routeName = '';
    private array $missingParameters = [];
    
    /**
     * @param string[] $missingParameters
     */
    public function __construct(string $routeName = '', array $missingParameters = [], int $code = 0, ?\Throwable $previous = null) {
        $this->routeName = $routeName;
        $this->missingParameters = $missingParameters;
        $message = \sprintf('Some mandatory parameters are missing ("%s") to generate a URL for route "%s".', implode('", "', $missingParameters), $routeName);
        parent::__construct($message, $code, $previous);
    }
    
    /**
     * @return string[]
     */
    public function getMissingParameters() : array {
        return $this->missingParameters;
    }
    public function getRouteName() : string {
        return $this->routeName;
    }

}

Members

Title Sort descending Modifiers Object type Summary
MissingMandatoryParametersException::$missingParameters private property
MissingMandatoryParametersException::$routeName private property
MissingMandatoryParametersException::getMissingParameters public function
MissingMandatoryParametersException::getRouteName public function
MissingMandatoryParametersException::__construct public function
RSS feed
Powered by Drupal