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

Breadcrumb

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

function GenericEvent::getArgument

Get argument by 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 53

Class

GenericEvent
Event encapsulation class.

Namespace

Symfony\Component\EventDispatcher

Code

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

API Navigation

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