Files
api/services/nginx/app/modules/selfserve/helpers/selfserve_lane_command.php
T

34 lines
1.3 KiB
PHP

<?php
namespace modules\selfserve\helpers;
enum selfserve_lane_command
{
case START; // command to start the lane
case STOP; // command to stop the lane
case RESET; // command to reset the lane
case RESERVE; // command to reserve the lane
case RELEASE; // command to release the lane (from reservation)
case OPEN_PROPERTY_ACCESS_GATE; // command to open the outer gate (when applicable) to allow access to the physical property premises.
case OPEN_PROPERTY_EXIT_GATE; // command to open the outer gate (when applicable) to allow exit from the physical property premises.
public static function tryFrom(string $commandParam): ?selfserve_lane_command
{
return match (strtoupper($commandParam)) {
'START' => selfserve_lane_command::START,
'STOP' => selfserve_lane_command::STOP,
'RESET' => selfserve_lane_command::RESET,
'RESERVE' => selfserve_lane_command::RESERVE,
'RELEASE' => selfserve_lane_command::RELEASE,
'OPEN_PROPERTY_ACCESS_GATE' => selfserve_lane_command::OPEN_PROPERTY_ACCESS_GATE,
'OPEN_PROPERTY_EXIT_GATE' => selfserve_lane_command::OPEN_PROPERTY_EXIT_GATE,
default => null,
};
}
public function equals(selfserve_lane_command $command): bool
{
return $this === $command;
}
}