for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace src;
use stdClass;
class CambiarValoresParaBaseDeDatosCuestionarioEts
{
public function cambiarTodosLosValoresDeTextoANumero(array $datos): object
$resultado = new stdClass;
foreach ($datos as $pregunta => $respuesta)
$resultado->{$pregunta} = $this->cambiarDeTextoANumero($pregunta, $respuesta);
}
return $resultado;
public function cambiarTodosLosValoresDeNumeroATexto(array $datos): object
$resultado->{$pregunta} = $this->cambiarDeNumeroATexto($pregunta, $respuesta);
public function cambiarDeTextoANumero(string $pregunta, string $valor): int
$pregunta
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function cambiarDeTextoANumero(/** @scrutinizer ignore-unused */ string $pregunta, string $valor): int
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$resultado = 2;
if($valor == 'No')
$resultado = 1;
public function cambiarDeNumeroATexto(string $pregunta, int $valor): string
public function cambiarDeNumeroATexto(/** @scrutinizer ignore-unused */ string $pregunta, int $valor): string
$resultado = 'Sí';
if($valor == 1)
$resultado = 'No';
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.