phpDoctor::_getNext PHP Method

_getNext() public method

Get next token of a certain type from token array
public _getNext ( &$tokens, $key, $whatToGet, $maxDist ) : str
return str Value of found token
    public function _getNext(&$tokens, $key, $whatToGet, $maxDist = 0)
    {
        $start = $key;
        $key++;
        if (!is_array($whatToGet)) {
            $whatToGet = array($whatToGet);
        }
        while (!is_array($tokens[$key]) || !in_array($tokens[$key][0], $whatToGet)) {
            $key++;
            if (!isset($tokens[$key]) || 0 < $maxDist && $key - $start > $maxDist) {
                return FALSE;
            }
        }
        return $tokens[$key][1];
    }