You are here

public function GenericEvent::getArgument in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/event-dispatcher/GenericEvent.php \Symfony\Component\EventDispatcher\GenericEvent::getArgument()

Get argument by key.

Parameters

string $key Key.:

Return value

mixed Contents of array key.

Throws

\InvalidArgumentException If key is not found.

1 call to GenericEvent::getArgument()
GenericEvent::offsetGet in vendor/symfony/event-dispatcher/GenericEvent.php
ArrayAccess for argument getter.

File

vendor/symfony/event-dispatcher/GenericEvent.php, line 68

Class

GenericEvent
Event encapsulation class.

Namespace

Symfony\Component\EventDispatcher

Code

public function getArgument($key) {
  if ($this
    ->hasArgument($key)) {
    return $this->arguments[$key];
  }
  throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key));
}