for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Rik van der Kemp <[email protected]>
* @author Gerard van Helden <[email protected]>
* @copyright Zicht Online <http://www.zicht.nl>
*/
namespace Zicht\Bundle\UrlBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
* Class SitemapController
*
* @package Zicht\Bundle\UrlBundle\Controller
class SitemapController extends Controller
{
* Render basic sitemap from all database urls
* @param Request $request
* @return Response
* @Route("/sitemap.{_format}", defaults={"_format": "xml"})
public function sitemapAction(Request $request)
$request
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
$urls = $this->get('zicht_url.sitemap_provider')->all($this->get('security.authorization_checker'));
return new Response(
$this->renderView('ZichtUrlBundle:Sitemap:sitemap.xml.twig', array('urls' => $urls)),
200,
array(
'content-type' => 'text/xml'
)
);
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.