Commit 14c08a7d authored by Thomas Eimers's avatar Thomas Eimers

fix phpstan errors

parent d8bf5f02
Pipeline #94727801 failed with stages
in 4 minutes and 31 seconds
......@@ -66,18 +66,18 @@ class RelayService
/**
* @param string $gpio
* @param bool $status self::IO_VALUE_ON, self::IO_VALUE_OFF
* @param bool $newStatus self::IO_VALUE_ON, self::IO_VALUE_OFF
* @return bool
* @throws HeatingException
*/
public function setRelay(string $gpio, bool $newStatus)
{
$this->isGpioValid($gpio);
if (!in_array($status, [self::IO_VALUE_ON, self::IO_VALUE_OFF])) {
if (!in_array($newStatus, [self::IO_VALUE_ON, self::IO_VALUE_OFF])) {
throw new HeatingException('Invalid Relay Status');
}
$cmd = 'echo ' . escapeshellarg((string)$status) . ' > /sys/class/gpio/' . escapeshellcmd($gpio) . '/value';
$cmd = 'echo ' . escapeshellarg((string)$newStatus) . ' > /sys/class/gpio/' . escapeshellcmd($gpio) . '/value';
$status = $this->commandService->exec(
$cmd
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment