RouteNamingStrategy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTransactionName() 0 3 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Ekino New Relic bundle.
7
 *
8
 * (c) Ekino - Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ekino\NewRelicBundle\TransactionNamingStrategy;
15
16
use Symfony\Component\HttpFoundation\Request;
17
18
/**
19
 * @author Magnus Nordlander
20
 */
21
class RouteNamingStrategy implements TransactionNamingStrategyInterface
22
{
23
    public function getTransactionName(Request $request): string
24
    {
25
        return $request->get('_route') ?: 'Unknown Symfony route';
26
    }
27
}
28