Passed
Push — feature/depend-on-metadata-inf... ( ef854e...953c11 )
by
unknown
39:13 queued 32:26
created

StaticReferenceController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 17
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A redirectAction() 0 5 1
1
<?php
2
/**
3
 * @copyright Zicht Online <http://zicht.nl>
4
 */
5
6
namespace Zicht\Bundle\UrlBundle\Controller;
7
8
use Symfony\Component\HttpFoundation\RedirectResponse;
9
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10
use Symfony\Component\HttpFoundation\Request;
11
use Symfony\Component\Routing\Annotation\Route;
12
13
/**
14
 * Utility controller to reference a static ref from outside the system.
15
 */
16
class StaticReferenceController extends Controller
17
{
18
    /**
19
     * Redirects to the url provided by the main url provider service.
20
     *
21
     * @param Request $request
22
     * @param string $name
23
     * @param int $code
24
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
25
     *
26
     * @Route("/_static-ref/{name}")
27
     */
28
    public function redirectAction(Request $request, $name, $code = 301)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

28
    public function redirectAction(/** @scrutinizer ignore-unused */ Request $request, $name, $code = 301)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
        return new RedirectResponse(
31
            $this->get('zicht_url.provider')->url($name),
32
            $code
33
        );
34
    }
35
}
36