for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of Flight Routing.
*
* PHP version 7.4 and above required
* @author Divine Niiquaye Ibok <[email protected]>
* @copyright 2019 Biurad Group (https://biurad.com/)
* @license https://opensource.org/licenses/BSD-3-Clause License
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flight\Routing\Tests\Fixtures\Annotation\Route\Valid;
use Flight\Routing\Annotation\Route;
class DefaultValueController
{
/**
* @Route("/{default}/path", methods={"GET", "POST"}, name="action")
public function action($default = 'value'): void
$default
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function action(/** @scrutinizer ignore-unused */ $default = 'value'): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
}
* @Route(
* "/hello/{name:\w+}",
* methods={"GET", "POST"},
* name="hello_without_default"
* )
* "/cool/{name=<Symfony>}",
* where={"name": "\w+"},
* name="hello_with_default"
public function hello(string $name = 'World'): void
$name
public function hello(/** @scrutinizer ignore-unused */ string $name = 'World'): void
private function notAccessed(): void
notAccessed()
This check looks for private methods that have been defined, but are not used inside the class.
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.