Exakat\Tasks\Precedence::get PHP Method

get() public method

public get ( $token, $itself = false )
    public function get($token, $itself = false)
    {
        static $cache;
        if ($cache === null) {
            $cache = array();
            foreach (self::$PRECEDENCE as $k1 => $p1) {
                $cache[$k1] = array();
                foreach (self::$PRECEDENCE as $k2 => $p2) {
                    if ($p1 <= $p2 && ($itself === true || $k1 !== $k2)) {
                        // && (!in_array($token, [T_COALESCE]) || $token !== $k2)
                        $cache[$k1][] = $k2;
                    }
                }
            }
        }
        if (!isset($cache[$token])) {
            throw new NoPrecedence($token);
        }
        return $cache[$token];
    }