1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace Symfony\Component\HttpKernel\Controller;
- use Symfony\Component\HttpFoundation\Request;
- use Symfony\Component\Stopwatch\Stopwatch;
- class TraceableArgumentResolver implements ArgumentResolverInterface
- {
- private $resolver;
- private $stopwatch;
- public function __construct(ArgumentResolverInterface $resolver, Stopwatch $stopwatch)
- {
- $this->resolver = $resolver;
- $this->stopwatch = $stopwatch;
- }
-
- public function getArguments(Request $request, callable $controller)
- {
- $e = $this->stopwatch->start('controller.get_arguments');
- try {
- return $this->resolver->getArguments($request, $controller);
- } finally {
- $e->stop();
- }
- }
- }
|