Completed
Push — master ( a5200d...3d485f )
by Paweł
51:04
created

RoutingExtension::getPath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 4
nc 2
nop 3
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Core Bundle.
5
 *
6
 * Copyright 2017 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2017 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
declare(strict_types=1);
16
17
namespace SWP\Bundle\CoreBundle\Twig;
18
19
use Symfony\Bridge\Twig\Extension\RoutingExtension as SymfonyRoutingExtension;
20
use Symfony\Component\Routing\Exception\RouteNotFoundException;
21
22
class RoutingExtension extends SymfonyRoutingExtension
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getPath($name, $parameters = array(), $relative = false)
28
    {
29
        try {
30
            return parent::getPath($name, $parameters, $relative);
31
        } catch (RouteNotFoundException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
32
        }
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getUrl($name, $parameters = array(), $schemeRelative = false)
39
    {
40
        try {
41
            return parent::getUrl($name, $parameters, $schemeRelative);
42
        } catch (RouteNotFoundException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
43
        }
44
    }
45
}
46