Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of the Symfony package.
5
 *
6
 * (c) Fabien Potencier <fabien@symfony.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Symfony\Component\HttpKernel\Controller;
13
 
14
use Symfony\Component\HttpFoundation\Request;
15
use Symfony\Component\Stopwatch\Stopwatch;
16
 
17
/**
18
 * @author Fabien Potencier <fabien@symfony.com>
19
 */
20
class TraceableControllerResolver implements ControllerResolverInterface
21
{
22
    private ControllerResolverInterface $resolver;
23
    private Stopwatch $stopwatch;
24
 
25
    public function __construct(ControllerResolverInterface $resolver, Stopwatch $stopwatch)
26
    {
27
        $this->resolver = $resolver;
28
        $this->stopwatch = $stopwatch;
29
    }
30
 
31
    public function getController(Request $request): callable|false
32
    {
33
        $e = $this->stopwatch->start('controller.get_callable');
34
 
991 lars 35
        try {
36
            return $this->resolver->getController($request);
37
        } finally {
38
            $e->stop();
39
        }
148 lars 40
    }
41
}