Passed
Push — main ( 50aede...a9f24b )
by Chema
01:07 queued 13s
created

FakeController   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A basicAction() 0 3 1
A stringParamAction() 0 4 1
A boolParamAction() 0 5 1
A manyParamsAction() 0 3 1
A intParamAction() 0 4 1
A floatParamAction() 0 4 1
A nonScalarParam() 0 3 1
A nonTypedParam() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Router\Fixtures;
6
7
final class FakeController
8
{
9
    public function basicAction(): string
10
    {
11
        return 'Expected!';
12
    }
13
14
    public function stringParamAction(string $param): string
15
    {
16
        $type = get_debug_type($param);
17
        return "The '{$type}' param is '{$param}'!";
18
    }
19
20
    public function intParamAction(int $param): string
21
    {
22
        $type = get_debug_type($param);
23
        return "The '{$type}' param is '{$param}'!";
24
    }
25
26
    public function floatParamAction(float $param): string
27
    {
28
        $type = get_debug_type($param);
29
        return "The '{$type}' param is '{$param}'!";
30
    }
31
32
    public function boolParamAction(bool $param): string
33
    {
34
        $type = get_debug_type($param);
35
        $stringParam = json_encode($param);
36
        return "The '{$type}' param is '{$stringParam}'!";
37
    }
38
39
    public function manyParamsAction(string $firstParam, string $secondParam, string $thirdParam): string
40
    {
41
        return "The params are '{$firstParam}', '{$secondParam}' and '{$thirdParam}'!";
42
    }
43
44
    /**
45
     * @param mixed $param
46
     */
47
    public function nonTypedParam($param): string
0 ignored issues
show
Unused Code introduced by
The parameter $param 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

47
    public function nonTypedParam(/** @scrutinizer ignore-unused */ $param): string

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...
48
    {
49
        return 'I AM ERROR!';
50
    }
51
52
    public function nonScalarParam(array $param): string
0 ignored issues
show
Unused Code introduced by
The parameter $param 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

52
    public function nonScalarParam(/** @scrutinizer ignore-unused */ array $param): string

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...
53
    {
54
        return 'I AM ERROR!';
55
    }
56
}
57