Back to AbstractImmutableEvent class

Method __construct

public
__construct
(string $name, array $arguments = [])
Constructor.
Parameters
  • string $name The event name.
  • array $arguments The event arguments.
Since
  • 4.0.0
-
  • \BadMethodCallException

Method __construct - Source code

/**
 * Constructor.
 *
 * @param   string  $name       The event name.
 * @param   array   $arguments  The event arguments.
 *
 * @since   4.0.0
 * @throws  BadMethodCallException
 */
public function __construct(string $name, array $arguments = [])
{
    if ($this->constructed) {
        throw new BadMethodCallException(sprintf('Cannot reconstruct the AbstractImmutableEvent %s.', $this->name));
    }
    $this->constructed = true;
    parent::__construct($name, $arguments);
}