Total Complexity | 8 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class CambiarValoresParaBaseDeDatosCuestionarioEts |
||
7 | { |
||
8 | public function cambiarTodosLosValoresDeTextoANumero(array $datos): object |
||
9 | { |
||
10 | $resultado = new stdClass; |
||
11 | |||
12 | foreach ($datos as $pregunta => $respuesta) |
||
13 | { |
||
14 | $resultado->{$pregunta} = $this->cambiarDeTextoANumero($pregunta, $respuesta); |
||
15 | } |
||
16 | |||
17 | return $resultado; |
||
18 | } |
||
19 | |||
20 | public function cambiarTodosLosValoresDeNumeroATexto(array $datos): object |
||
21 | { |
||
22 | $resultado = new stdClass; |
||
23 | |||
24 | foreach ($datos as $pregunta => $respuesta) |
||
25 | { |
||
26 | $resultado->{$pregunta} = $this->cambiarDeNumeroATexto($pregunta, $respuesta); |
||
27 | } |
||
28 | |||
29 | return $resultado; |
||
30 | } |
||
31 | |||
32 | public function cambiarDeTextoANumero(string $pregunta, string $valor): int |
||
|
|||
33 | { |
||
34 | $resultado = 2; |
||
35 | |||
36 | if($valor == 'No') |
||
37 | { |
||
38 | $resultado = 1; |
||
39 | } |
||
40 | |||
41 | return $resultado; |
||
42 | } |
||
43 | |||
44 | public function cambiarDeNumeroATexto(string $pregunta, int $valor): string |
||
54 | } |
||
55 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.