RedirectableUrlMatcher   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 21
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A redirect() 0 9 1
1
<?php
2
/**
3
 * This file contains functionality relating to redirecting routes
4
 *
5
 * @package    BZiON\Models
6
 * @license    https://github.com/allejo/bzion/blob/master/LICENSE.md GNU General Public License Version 3
7
 */
8
9
namespace BZIon\Routing;
10
11
use Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher as BaseMatcher;
12
13
/**
14
 * A URL matcher that redirects the user
15
 */
16
class RedirectableUrlMatcher extends BaseMatcher
17
{
18
    /**
19
     * Redirects the user to another URL.
20
     *
21
     * @param string $path   The path info to redirect to.
22
     * @param string $route  The route that matched
23
     * @param string $scheme The URL scheme (null to keep the current one)
24
     *
25
     * @return array An array of parameters
26
     */
27
    public function redirect($path, $route, $scheme = null)
28
    {
29
        $array = parent::redirect($path, $route, $scheme);
30
31
        // Make sure that the kernel knows how to properly handle this route
32
        $array['_defaultHandler'] = true;
33
34
        return $array;
35
    }
36
}
37