OsvaldoGDelRio /
custionario-ets-nom035-stps
| 1 | <?php |
||||
| 2 | namespace src; |
||||
| 3 | |||||
| 4 | use stdClass; |
||||
| 5 | |||||
| 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 |
||||
|
0 ignored issues
–
show
|
|||||
| 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 |
||||
|
0 ignored issues
–
show
The parameter
$pregunta 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
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 | $resultado = 'Sí'; |
||||
| 47 | |||||
| 48 | if($valor == 1) |
||||
| 49 | { |
||||
| 50 | $resultado = 'No'; |
||||
| 51 | } |
||||
| 52 | |||||
| 53 | return $resultado; |
||||
| 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.