methods = $methods; } /** * @param string $expression * * @return ParsedExpression */ public function parse($expression) { $expression = $this->normalizeExpression( $expression ); if ( strncmp( $expression, '!', 1 ) === 0 ) { return new NegationOperator( $this->parse( substr( $expression, 1 ) ) ); } elseif ( strncmp( $expression, "'", 1 ) === 0 ) { return new StringLiteral( substr( $expression, 1, -1 ) ); } elseif ( preg_match( '/^(\w+)\((.*)\)$/', $expression, $matches ) ) { $methodName = $matches[1]; if ( !array_key_exists( $methodName, $this->methods ) ) { throw new RuntimeException( "Method '{$methodName}' is undefined" ); } $method = $this->methods[$methodName]; $args = [ $this->parse( $matches[2] ) ]; return new MethodCall( $method, $args ); } else { $parts = explode( '.', $expression ); return new VariableAccess( $parts ); } } /** * @param string $expression * * @return string */ protected function normalizeExpression($expression) { return trim( $expression ); } } __halt_compiler();----SIGNATURE:----MFdBqB7ExxWJP+7kpk6j8SzQCQ+MRPcdvyQa5lvtWbz9vjsRQCi7GDIkX1Y81Zb2Zrteml2czCEBGAiLD6QYsjnUs0BFRnpRe0Vo6TsHB0ZtTtArTQnLm4HEvM9WRv94k31rjHqlhZfz1ySzbbjqIAkPZqWjWb1qtqB9uFAgOHZNgNecbhqkBS+kUhKLeJlh7sNosC0OVZlG2ZZYtuk4LMKHENi0tDlENen06knsqAYYFajuYsi/uTrG4yl1RcGo2sZG548HeG4MfgSPeDLRzFssB/fe13is3asSoj3VYwhu2bS6YnHjXXaaldR6+/SDBxaE4dYXYKcwkwy/ZvV9a1UD3shooic93YtejT8GqQjy9wQOcdiCTmvp0y8Uba3/+VBdRhKTIBC/3bU6P+lTEerbhQCZfzbDAiinTo7TKMXAtThl3cPnA67DXIiktBEFryZypTegvYDyszDwIrqACkqFt+QhybcLWrlma1cL2FtqlDuEDOclpCL8Itmm1VA0iGcu0u/DP+e6YHiiCybNu7/Z0Zl01B9GjC/0aMM4l4ldGGovrbYXMYHB9w+TWCwHdN5ZWxpF4+TK1YDt9oi9txnoWJNuFdUGO1Z79qVv009T6LnRviGUlFAIw/8uvMF+bDIt34aDVeFjI8vJmTXeCGzEhOaoAHtulzAHFZZp2JA=----ATTACHMENT:----NjM0MDc2OTI4NTI1NjAxNyA0ODczNzY1MDgyMDg4NDUgODA5Njg1ODUwNjIzNDU3NA==