Back to AbstractEvent class

Method __construct

public
__construct
(mixed $name, array $arguments = array())
Constructor.
Parameters
  • string $name The event name.
  • array $arguments The event arguments.
Since
  • 4.0.0
-
  • \BadMethodCallException
Class: AbstractEvent
Project: Joomla

Method __construct - Source code

/**
 * Constructor.
 *
 * @param   string  $name       The event name.
 * @param   array   $arguments  The event arguments.
 *
 * @throws  BadMethodCallException
 *
 * @since   4.0.0
 */
public function __construct($name, array $arguments = array())
{
    if (!\array_key_exists('subject', $arguments)) {
        throw new BadMethodCallException("Argument 'subject' of event {$this->name} is required but has not been provided");
    }
    parent::__construct($name, $arguments);
}