SitemapController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 7
c 2
b 0
f 1
dl 0
loc 19
ccs 0
cts 8
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A sitemapAction() 0 9 1
1
<?php
2
/**
3
 * @author Rik van der Kemp <[email protected]>
4
 * @author Gerard van Helden <[email protected]>
5
 * @copyright Zicht Online <http://www.zicht.nl>
6
 */
7
8
namespace Zicht\Bundle\UrlBundle\Controller;
9
10
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
11
use Symfony\Component\HttpFoundation\Request;
12
use Symfony\Component\HttpFoundation\Response;
13
use Symfony\Component\Routing\Annotation\Route;
14
15
/**
16
 * Class SitemapController
17
 *
18
 * @package Zicht\Bundle\UrlBundle\Controller
19
 */
20
class SitemapController extends Controller
21
{
22
    /**
23
     * Render basic sitemap from all database urls
24
     *
25
     * @param Request $request
26
     * @return Response
27
     *
28
     * @Route("/sitemap.{_format}", defaults={"_format": "xml"})
29
     */
30
    public function sitemapAction(Request $request)
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

30
    public function sitemapAction(/** @scrutinizer ignore-unused */ Request $request)

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...
31
    {
32
        $urls = $this->get('zicht_url.sitemap_provider')->all($this->get('security.authorization_checker'));
33
34
        return new Response(
35
            $this->renderView('ZichtUrlBundle:Sitemap:sitemap.xml.twig', array('urls' => $urls)),
36
            200,
37
            array(
38
                'content-type' => 'text/xml'
39
            )
40
        );
41
    }
42
}
43