Passed
Pull Request — release/4.x (#44)
by Erik
07:43 queued 03:55
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
 * @author Gerard van Helden <[email protected]>
4
 * @copyright Zicht Online <http://zicht.nl>
5
 */
6
7
namespace Zicht\Bundle\UrlBundle\Controller;
8
9
use Symfony\Component\HttpFoundation\RedirectResponse;
10
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
11
use Symfony\Component\HttpFoundation\Request;
12
use Symfony\Component\Routing\Annotation\Route;
13
14
/**
15
 * Utility controller to reference a static ref from outside the system.
16
 */
17
class StaticReferenceController extends Controller
18
{
19
    /**
20
     * Redirects to the url provided by the main url provider service.
21
     *
22
     * @param Request $request
23
     * @param string $name
24
     * @param int $code
25
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
26
     *
27
     * @Route("/_static-ref/{name}")
28
     */
29
    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

29
    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...
30
    {
31
        return new RedirectResponse(
32
            $this->get('zicht_url.provider')->url($name),
33
            $code
34
        );
35
    }
36
}
37