src/Common/Events/Base.php
protected static function parse(\ReflectionClass $oReflectionClass)
    {
        $sContent = file_get_contents($oReflectionClass->getFileName());
        $aTokens  = token_get_all($sContent);

        $sDocComment = null;
        $bIsConst    = false;
        foreach ($aTokens as $aToken) {
            if (!is_array($aToken) || count($aToken) <= 1) {
                continue;
            }

            list($iTokenType, $sTokenValue) = $aToken;

            switch ($iTokenType) {
                // Ignored tokens
                case T_WHITESPACE:
                case T_COMMENT:
                    break;

                case T_DOC_COMMENT:
                    $sDocComment = $sTokenValue;
                    break;

                case T_CONST:
                    $bIsConst = true;
                    break;

                case T_STRING:
                    if ($bIsConst) {
                        static::$aDescriptions[$sTokenValue] = self::extractDescription($sDocComment);
                        static::$aArguments[$sTokenValue]    = self::extractArgument($sDocComment);
                    }
                    $sDocComment = null;
                    $bIsConst    = false;
                    break;

                // All other tokens reset the parser
                default:
                    $sDocComment = null;
                    $bIsConst    = false;
                    break;
            }
        }
    }
protected static function parse(\ReflectionClass $oReflectionClass)
    {
        $sContent = file_get_contents($oReflectionClass->getFileName());
        $aTokens  = token_get_all($sContent);

        $sDocComment = null;
        $bIsConst    = false;
        foreach ($aTokens as $aToken) {
            if (!is_array($aToken) || count($aToken) <= 1) {
                continue;
            }

            list($iTokenType, $sTokenValue) = $aToken;

            switch ($iTokenType) {
                // Ignored tokens
                case T_WHITESPACE:
                case T_COMMENT:
                    break;

                case T_DOC_COMMENT:
                    $sDocComment = $sTokenValue;
                    break;

                case T_CONST:
                    $bIsConst = true;
                    break;

                case T_STRING:
                    if ($bIsConst) {
                        static::$aDescriptions[$sTokenValue] = self::extractDescription($sDocComment);
                        static::$aArguments[$sTokenValue]    = self::extractArgument($sDocComment);
                    }
                    $sDocComment = null;
                    $bIsConst    = false;
                    break;

                // All other tokens reset the parser
                default:
                    $sDocComment = null;
                    $bIsConst    = false;
                    break;
            }
        }
    }
protected static function parse ( \ ReflectionClass $ oReflectionClass ) { $ sContent = file_get_contents ( $ oReflectionClass -> getFileName ( ) ) ; $ aTokens = token_get_all ( $ sContent ) ; $ sDocComment = null ; $ bIsConst = false ; foreach ( $ aTokens as $ aToken ) { if ( ! is_array ( $ aToken ) || count ( $ aToken ) <= 1 ) { continue ; } list ( $ iTokenType , $ sTokenValue ) = $ aToken ; switch ( $ iTokenType ) { // Ignored tokens case T_WHITESPACE : case T_COMMENT : break ; case T_DOC_COMMENT : $ sDocComment = $ sTokenValue ; break ; case T_CONST : $ bIsConst = true ; break ; case T_STRING : if ( $ bIsConst ) { static :: $ aDescriptions [ $ sTokenValue ] = self :: extractDescription ( $ sDocComment ) ; static :: $ aArguments [ $ sTokenValue ] = self :: extractArgument ( $ sDocComment ) ; } $ sDocComment = null ; $ bIsConst = false ; break ; // All other tokens reset the parser default : $ sDocComment = null ; $ bIsConst = false ; break ; } } }
Parses a class for constants and DocComments

@param \ReflectionClass $oReflectionClass
Parses a class for constants and DocComments