* @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net) */ abstract class Priority { const LOWEST = 5; const LOW = 4; const NORMAL = 3; const HIGH = 2; const HIGHEST = 1; const MONITOR = 0; /** * Returns the string of the priority based on the integer. * * @param $intPriorty * * @return bool|string A bool when the integer isn't a priority. If the integer is a priority, the name is returned */ public static function getPriority($intPriorty) { switch ($intPriorty) { case 5: return 'Priority::LOWEST'; case 4: return 'Priority::LOW'; case 3: return 'Priority::NORMAL'; case 2: return 'Priority::HIGH'; case 1: return 'Priority::HIGHEST'; case 0: return 'Priority::MONITOR'; default: return false; } } /** * Returns the highest priority * This function is needed for executing in the right order. * * @return int */ public static function getHighestPriority(): int { return self::MONITOR; } /** * Returns the lowest priority * This function is needed for executing in the right order. * * @return int */ public static function getLowestPriority(): int { return self::LOWEST; } }