private function getArrayEntry()
    {
        $glimpse = $this->lexer->glimpse();
        $tokens = array();

        // append the correct assignment token: ":" or "="
        if (DocLexer::T_COLON === $glimpse['type']) {
            $token = array(DocLexer::T_COLON);
        } elseif (DocLexer::T_EQUALS === $glimpse['type']) {
            $token = array(DocLexer::T_EQUALS);
        }

        // is it an assignment?
        if (isset($token)) {

            // if the key is a constant, hand off
            if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
                $tokens = $this->getConstant();

                // match only integer and string keys
            } else {
                $this->matchAny(
                    array(
                        DocLexer::T_INTEGER,
                        DocLexer::T_STRING
                    )
                );

                $tokens = array(
                    array(
                        $this->lexer->token['type'],
                        $this->lexer->token['value']
                    )
                );
            }

            $tokens[] = $token;

            $this->matchAny(
                array(
                    DocLexer::T_COLON,
                    DocLexer::T_EQUALS
                )
            );
        }

        // merge in the value
        return array_merge($tokens, $this->getPlainValue());
    }
private function getArrayEntry()
    {
        $glimpse = $this->lexer->glimpse();
        $tokens = array();

        // append the correct assignment token: ":" or "="
        if (DocLexer::T_COLON === $glimpse['type']) {
            $token = array(DocLexer::T_COLON);
        } elseif (DocLexer::T_EQUALS === $glimpse['type']) {
            $token = array(DocLexer::T_EQUALS);
        }

        // is it an assignment?
        if (isset($token)) {

            // if the key is a constant, hand off
            if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
                $tokens = $this->getConstant();

                // match only integer and string keys
            } else {
                $this->matchAny(
                    array(
                        DocLexer::T_INTEGER,
                        DocLexer::T_STRING
                    )
                );

                $tokens = array(
                    array(
                        $this->lexer->token['type'],
                        $this->lexer->token['value']
                    )
                );
            }

            $tokens[] = $token;

            $this->matchAny(
                array(
                    DocLexer::T_COLON,
                    DocLexer::T_EQUALS
                )
            );
        }

        // merge in the value
        return array_merge($tokens, $this->getPlainValue());
    }
private function getArrayEntry ( ) { $ glimpse = $ this -> lexer -> glimpse ( ) ; $ tokens = array ( ) ; // append the correct assignment token: ":" or "=" if ( DocLexer :: T_COLON === $ glimpse [ 'type' ] ) { $ token = array ( DocLexer :: T_COLON ) ; } elseif ( DocLexer :: T_EQUALS === $ glimpse [ 'type' ] ) { $ token = array ( DocLexer :: T_EQUALS ) ; } // is it an assignment? if ( isset ( $ token ) ) { // if the key is a constant, hand off if ( $ this -> lexer -> isNextToken ( DocLexer :: T_IDENTIFIER ) ) { $ tokens = $ this -> getConstant ( ) ; // match only integer and string keys } else { $ this -> matchAny ( array ( DocLexer :: T_INTEGER , DocLexer :: T_STRING ) ) ; $ tokens = array ( array ( $ this -> lexer -> token [ 'type' ] , $ this -> lexer -> token [ 'value' ] ) ) ; } $ tokens [ ] = $ token ; $ this -> matchAny ( array ( DocLexer :: T_COLON , DocLexer :: T_EQUALS ) ) ; } // merge in the value return array_merge ( $ tokens , $ this -> getPlainValue ( ) ) ; }
Returns the tokens for the next array entry.

@return array The tokens.
Returns the tokens for the next array entry .