public function resolve($callback) : \Closure { if (is_array($callback) && $callback[0] instanceof Reference) { $callback[0] = $this->app[(string) $callback[0]] ?? $callback[0]; } return \Closure::fromCallable($callback); }
/** * @expectedException \TypeError */ public function testSetInvalidCallbackRaiseException() { $event = new ControllerEvent(function () { }); $this->assertSame($event, $event->setCallback('rand')); $event->setCallback(\Closure::fromCallable('foobar')); }