/** * Get the function prototype as string * * @return string */ public function getPrototypeAsString() { $str = $this->returnType->getFullTypeName() . ' ' . $this->name . '('; foreach ($this->argumentTypes as $argumentType) { $str .= $argumentType->getFullTypeName() . ', '; } return rtrim($str, ', ') . ')'; }
/** * Parse primitive type literal. * * @param IType $targetType Expected type of the current literal. * * @return AbstractExpression * * @throws ODataException */ private function _parseTypedLiteral(IType $targetType) { $literal = $this->_lexer->getCurrentToken()->Text; $outVal = null; if (!$targetType->validate($literal, $outVal)) { throw ODataException::createSyntaxError(Messages::expressionParserUnrecognizedLiteral($targetType->getFullTypeName(), $literal, $this->_lexer->getCurrentToken()->Position)); } $result = new ConstantExpression($outVal, $targetType); $this->_lexer->nextToken(); return $result; }