Completed
Pull Request — master (#1205)
by Rafał
10:14
created

RedirectableUrlMatcher::redirect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Web Publisher Content Bundle.
7
 *
8
 * Copyright 2021 Sourcefabric z.ú. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2021 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
18
namespace SWP\Bundle\ContentBundle\Routing;
19
20
use Symfony\Component\Routing\Matcher\RedirectableUrlMatcher as BaseRedirectableUrlMatcher;
21
22
class RedirectableUrlMatcher extends BaseRedirectableUrlMatcher
23
{
24
    public function redirect($path, $route, $scheme = null): array
25
    {
26
        return [
27
            '_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction',
28
            'path' => $path,
29
            'permanent' => true,
30
            'scheme' => $scheme,
31
            'httpPort' => $this->context->getHttpPort(),
32
            'httpsPort' => $this->context->getHttpsPort(),
33
            '_route' => $route,
34
        ];
35
    }
36
}
37