private function parse(\ReflectionClass $clazz)
    {
        $content = file_get_contents($clazz->getFileName());
        $tokens = token_get_all($content);

        $doc = null;
        $isConst = false;
        foreach ($tokens as $token) {
            @ list($tokenType, $tokenValue) = $token;

            switch ($tokenType) {
                // ignored tokens
                case T_WHITESPACE:
                case T_COMMENT:
                    break;

                case T_DOC_COMMENT:
                    $doc = $tokenValue;
                    break;

                case T_CONST:
                    $isConst = true;
                    break;

                case T_STRING:
                    if ($isConst) {
                        $this->docComments[$tokenValue] = self::clean($doc);
                    }
                    $doc = null;
                    $isConst = false;
                    break;

                // all other tokens reset the parser
                default:
                    $doc = null;
                    $isConst = false;
                    break;
            }
        }

    }
private function parse(\ReflectionClass $clazz)
    {
        $content = file_get_contents($clazz->getFileName());
        $tokens = token_get_all($content);

        $doc = null;
        $isConst = false;
        foreach ($tokens as $token) {
            @ list($tokenType, $tokenValue) = $token;

            switch ($tokenType) {
                // ignored tokens
                case T_WHITESPACE:
                case T_COMMENT:
                    break;

                case T_DOC_COMMENT:
                    $doc = $tokenValue;
                    break;

                case T_CONST:
                    $isConst = true;
                    break;

                case T_STRING:
                    if ($isConst) {
                        $this->docComments[$tokenValue] = self::clean($doc);
                    }
                    $doc = null;
                    $isConst = false;
                    break;

                // all other tokens reset the parser
                default:
                    $doc = null;
                    $isConst = false;
                    break;
            }
        }

    }
private function parse ( \ ReflectionClass $ clazz ) { $ content = file_get_contents ( $ clazz -> getFileName ( ) ) ; $ tokens = token_get_all ( $ content ) ; $ doc = null ; $ isConst = false ; foreach ( $ tokens as $ token ) { @ list ( $ tokenType , $ tokenValue ) = $ token ; switch ( $ tokenType ) { // ignored tokens case T_WHITESPACE : case T_COMMENT : break ; case T_DOC_COMMENT : $ doc = $ tokenValue ; break ; case T_CONST : $ isConst = true ; break ; case T_STRING : if ( $ isConst ) { $ this -> docComments [ $ tokenValue ] = self :: clean ( $ doc ) ; } $ doc = null ; $ isConst = false ; break ; // all other tokens reset the parser default : $ doc = null ; $ isConst = false ; break ; } } }
Parses the class for constant DocComments.
Parses the class for constant DocComments .