Fuel\Event\Listener::__construct PHP Méthode

__construct() public méthode

Constructor
public __construct ( string $event, callable $handler, mixed $context = null, integer $priority = null )
$event string event name
$handler callable handler
$context mixed closure context
$priority integer closure context
    public function __construct($event, $handler, $context = null, $priority = null)
    {
        if (is_int($context)) {
            $priority = $context;
            $context = null;
        }
        if (!is_callable($handler)) {
            throw new \InvalidArgumentException('Handlers must be callable');
        }
        if ($context and !is_object($context)) {
            throw new \InvalidArgumentException('Contexts must be objects');
        }
        $this->event = $event;
        $this->handler = $handler;
        $this->context = $context;
        $this->priority = $priority;
    }