Passed
Push — main ( 3a9c9f...17fbbc )
by Chema
09:55 queued 07:39
created

FakeController   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A stringParamAction() 0 4 1
A boolParamAction() 0 5 1
A floatParamAction() 0 4 1
A manyParamsAction() 0 3 1
A intParamAction() 0 4 1
A basicAction() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Unit\Router;
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