TraceableControllerResolver example

$stopwatch = $this->createStub(Stopwatch::class);
        $stopwatch->method('start')->willReturn($stopwatchEvent);

        $resolver = new class() implements ControllerResolverInterface {
            public function getController(Request $request): callable|false
            {
                throw new \Exception();
            }
        };

        $traceableResolver = new TraceableControllerResolver($resolver$stopwatch);
        try {
            $traceableResolver->getController(new Request());
        } catch (\Exception $ex) {
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.