| Total Complexity | 9 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class FakeController |
||
| 8 | { |
||
| 9 | public function basicAction(): string |
||
| 12 | } |
||
| 13 | |||
| 14 | public function stringParamAction(string $param): string |
||
| 18 | } |
||
| 19 | |||
| 20 | public function optionalStringParamAction(string $param = 'bob'): string |
||
| 21 | { |
||
| 22 | $type = get_debug_type($param); |
||
| 23 | return "The optional '{$type}' param is '{$param}'!"; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function intParamAction(int $param): string |
||
| 27 | { |
||
| 28 | $type = get_debug_type($param); |
||
| 29 | return "The '{$type}' param is '{$param}'!"; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function floatParamAction(float $param): string |
||
| 33 | { |
||
| 34 | $type = get_debug_type($param); |
||
| 35 | return "The '{$type}' param is '{$param}'!"; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function boolParamAction(bool $param): string |
||
| 39 | { |
||
| 40 | $type = get_debug_type($param); |
||
| 41 | $stringParam = json_encode($param); |
||
| 42 | return "The '{$type}' param is '{$stringParam}'!"; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function manyParamsAction(string $firstParam, string $secondParam, string $thirdParam): string |
||
| 46 | { |
||
| 47 | return "The params are '{$firstParam}', '{$secondParam}' and '{$thirdParam}'!"; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param mixed $param |
||
| 52 | */ |
||
| 53 | public function nonTypedParam($param): string |
||
|
|
|||
| 54 | { |
||
| 55 | return 'I AM ERROR!'; |
||
| 56 | } |
||
| 57 | |||
| 58 | public function nonScalarParam(array $param): string |
||
| 61 | } |
||
| 62 | } |
||
| 63 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.