name = $name; $this->handler = $handler; } public function getName(): string { return $this->name; } public function call(Context $context): PromiseInterface { return new Promise(function (callable $resolve) use ($context) { $resolve(call_user_func($this->handler, $context)); return; }); } }