phpDoctor::_getPrev PHP 메소드

_getPrev() 공개 메소드

Get previous token of a certain type from token array
public _getPrev ( &$tokens, $key, $whatToGet ) : str
리턴 str Value of found token
    public function _getPrev(&$tokens, $key, $whatToGet)
    {
        $key--;
        if (!is_array($whatToGet)) {
            $whatToGet = array($whatToGet);
        }
        while (!is_array($tokens[$key]) || !in_array($tokens[$key][0], $whatToGet)) {
            $key--;
            if (!isset($tokens[$key])) {
                return FALSE;
            }
        }
        return $tokens[$key][1];
    }