for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Jarvis\Skill\EventBroadcaster;
/**
* @author Eric Chau <[email protected]>
*/
class ControllerEvent extends SimpleEvent
{
private $callback;
private $arguments;
public function __construct(\Closure $callback, array $arguments = [])
$this->callback = $callback;
$this->arguments = $arguments;
}
* @codeCoverageIgnore
*
* @return mixed
public function callback(): \Closure
return $this->callback;
* Set new callback to ControllerEvent. It must be callable.
* @param mixed $callback The new callback to set
* @return self
* @throws \InvalidArgumentException if passed callback is not callable
public function setCallback(\Closure $callback): ControllerEvent
return $this;
* @return array
public function arguments(): array
return $this->arguments;
* Sets new list of arguments to ControllerEvent.
* @param array $arguments The new arguments to set, default: empty array ([])
public function setArguments(array $arguments = []): ControllerEvent