public function __invoke()
{
if ($this->isReady) {
throw new \RuntimeException('Was already invoked!');
} else {
foreach ($this->getCommands() as $list) {
list($command, $arguments) = $list;
call_user_func_array($command, $arguments);
}
$this->isReady = true;
foreach ($this->onReadyCallbacks as $onReadyCallback) {
$onReadyCallback();
}
}
}