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

Breadcrumb

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

function ArgumentMetadata::getDefaultValue

Returns the default value of the argument.

Throws

\LogicException if no default value is present; {

See also

self::hasDefaultValue()}

File

vendor/symfony/http-kernel/ControllerMetadata/ArgumentMetadata.php, line 88

Class

ArgumentMetadata
Responsible for storing metadata of an argument.

Namespace

Symfony\Component\HttpKernel\ControllerMetadata

Code

public function getDefaultValue() : mixed {
    if (!$this->hasDefaultValue) {
        throw new \LogicException(\sprintf('Argument $%s does not have a default value. Use "%s::hasDefaultValue()" to avoid this exception.', $this->name, __CLASS__));
    }
    return $this->defaultValue;
}

API Navigation

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