DefaultValueController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A action() 0 2 1
A notAccessed() 0 2 1
A hello() 0 2 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of Flight Routing.
5
 *
6
 * PHP version 8.0 and above required
7
 *
8
 * @author    Divine Niiquaye Ibok <[email protected]>
9
 * @copyright 2019 Divine Niiquaye Ibok (https://divinenii.com/)
10
 * @license   https://opensource.org/licenses/BSD-3-Clause License
11
 *
12
 * For the full copyright and license information, please view the LICENSE
13
 * file that was distributed with this source code.
14
 */
15
16
namespace Flight\Routing\Tests\Fixtures\Annotation\Route\Valid;
17
18
use Flight\Routing\Annotation\Route;
19
20
class DefaultValueController
21
{
22
    /**
23
     * @Route("/{default}/path", methods={"GET", "POST"}, name="action")
24
     *
25
     * @param mixed $default
26
     */
27
    public function action($default = 'value'): void
0 ignored issues
show
Unused Code introduced by
The parameter $default 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

27
    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.

Loading history...
28
    {
29
    }
30
31
    /**
32
     * @Route(
33
     *     "/hello/{name:\w+}",
34
     *     methods={"GET", "POST"},
35
     *     name="hello_without_default"
36
     * )
37
     * @Route(
38
     *     "/cool/{name=<Symfony>}",
39
     *     where={"name": "\w+"},
40
     *     methods={"GET", "POST"},
41
     *     name="hello_with_default"
42
     * )
43
     */
44
    public function hello(string $name = 'World'): void
0 ignored issues
show
Unused Code introduced by
The parameter $name 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

44
    public function hello(/** @scrutinizer ignore-unused */ string $name = 'World'): void

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...
45
    {
46
    }
47
48
    private function notAccessed(): void
0 ignored issues
show
Unused Code introduced by
The method notAccessed() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
49
    {
50
    }
51
}
52