Call-back for function call expression

@param FunctionDescription $functionDescription Description of the function.
@param array<string>       $params              Paameters to the function.

@return string
358593
public function onFunctionCallExpression($functionDescription, $params) {
        $prefix = $this->_iterName;
        switch ($functionDescription->functionName) {
            case ODataConstants::STRFUN_COMPARE:
                return $prefix.self::STRFUN_COMPARE.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_ENDSWITH:
                return $prefix.self::STRFUN_ENDSWITH.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_INDEXOF:
                return $prefix.self::STRFUN_INDEXOF.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_REPLACE:
                return $prefix.self::STRFUN_REPLACE.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::COMMA.$params[2].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_STARTSWITH:
                return $prefix.self::STRFUN_STARTSWITH.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_TOLOWER:
                 return $prefix.self::STRFUN_TOLOWER.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_TOUPPER:
                return $prefix.self::STRFUN_TOUPPER.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_TRIM:
                return $prefix.self::STRFUN_TRIM.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_SUBSTRING:
                return $prefix.self::STRFUN_SUBSTRING.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1]
                    .(count($params) == 3 ? (self::COMMA.$params[2]) : '').self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_SUBSTRINGOF:
                return $prefix.self::STRFUN_SUBSTRINGOF.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break;
            case ODataConstants::STRFUN_CONCAT:
                return $prefix.self::STRFUN_CONCAT.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break; 
            case ODataConstants::STRFUN_LENGTH:
                return $prefix.self::STRFUN_LENGTH.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::GUIDFUN_EQUAL:
                return $prefix.self::GUIDFUN_EQUAL.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break;
            case ODataConstants::DATETIME_COMPARE:
//                exit($prefix.self::DATETIME_COMPARE.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET);
                return $prefix.self::DATETIME_COMPARE.self::OPEN_BRAKET.$params[0].self::COMMA.$params[1].self::CLOSE_BRACKET;
                break;
            case ODataConstants::DATETIME_YEAR:
                return $prefix.self::DATETIME_YEAR.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::DATETIME_MONTH:
                return $prefix.self::DATETIME_MONTH.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::DATETIME_DAY:
                return $prefix.self::DATETIME_DAY.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::DATETIME_HOUR:
                return $prefix.self::DATETIME_HOUR.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::DATETIME_MINUTE:
                return $prefix.self::DATETIME_MINUTE.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::DATETIME_SECOND:
                return $prefix.self::DATETIME_SECOND.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::MATHFUN_ROUND:
                return $prefix.self::MATHFUN_ROUND.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::MATHFUN_CEILING:
                return $prefix.self::MATHFUN_CEILING.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::MATHFUN_FLOOR:
                return $prefix.self::MATHFUN_FLOOR.self::OPEN_BRAKET.$params[0].self::CLOSE_BRACKET;
                break;
            case ODataConstants::BINFUL_EQUAL:
                return "($params[0] = $params[1])";
                break;
            case 'is_null':
                return "is_null($params[0])";
                break;

            default:
                throw new \InvalidArgumentException('onFunctionCallExpression');
        }
    }
1226608
protected function createArgumentDescriptor($functionDescriptor, $argument)
    {
        $params = $functionDescriptor->getTags()->get('param', array());

        if (!$this->argumentAssembler->getBuilder()) {
            $this->argumentAssembler->setBuilder($this->builder);
        }

        return $this->argumentAssembler->create($argument, $params);
    }
173948
private function _processFunctionCall($text) {
		if (strtolower($text) === "define") {
			$this->_constantDef = true;
		}

		if ($this->tokenizer->checkNextValidToken(T_PARENTHESIS_OPEN)) {
			// ASSUMPTION:that T_STRING followed by "(" is a function call
			$this->_inFuncCall = true;

			array_push($this->_currentFuncCall, $text);

			// Add the function name to the list of used functions
			$this->_usedFunctions[$text] = $text;

			// Check if the function call is made on an object of if it's a base PHP function.
			$isObjectCall = $this->tokenizer->checkPreviousToken(T_OBJECT_OPERATOR);

			if (!$isObjectCall) {

				// Detect prohibited functions
				$this->_checkProhibitedFunctions($text);

				// Detect deprecated functions
				$this->_checkDeprecation($text);

				// Detect aliased functions
				$this->_checkAliases($text);

				// Detect replaced functions
				$this->_checkReplacements($text);
			}

			// Detect an @ before the function call
			$this->_checkSilenced($text);

			// Detect space after function name
			if ($this->_isActive('noSpaceAfterFunctionName')) {
				if (!$this->tokenizer->checkNextToken(T_PARENTHESIS_OPEN)) {
					$msg = $this->_getMessage('NO_SPACE_AFTER_TOKEN', $text);
					$this->_writeError('noSpaceAfterFunctionName', $msg);
				}
			}
		}

		// Optimisation : Avoid using count/sizeof inside a loop
		if ($this->_isActive('functionInsideLoop')) {
			if ((strtolower($text) === 'count' || strtolower($text) === 'sizeof') && $this->_inControlStatement) {
				$loops = array(
					'do',
					'while',
					'for',
					'foreach'
				);
				if (in_array($this->_currentStatement, $loops)) {
					$msg = $this->_getMessage('FUNCTION_INSIDE_LOOP', strtolower($text));
					$this->_writeError('functionInsideLoop', $msg);
				}
			}
		}
	}
692945
function createdDescriptionCallback(description)
    {
        scope._conn.setLocalDescription(description)
        .then(function()
        {
            if(scope.onDescription)
            {
                scope.onDescription(scope,JSON.stringify({'sdp': scope._conn.localDescription}));
            }
        })
        .catch(onErrorCallback);
    }
357637
public function setDisplayDescription( $displayDescription )
    {
        if ( empty( $displayDescription ) )
        {
            $displayDescription = array();
        }
        else if ( $displayDescription instanceof Traversable )
        {
            $displayDescription = ArrayUtils::iteratorToArray( $displayDescription );
        }
        else if ( ! is_array( $displayDescription ) )
        {
            $displayDescription = (array) $displayDescription;
        }

        if ( ! isset( $displayDescription[static::FALLBACK_LOCALE] ) )
        {
            reset( $displayDescription );
            $key = key( $displayDescription );
            $displayDescription[static::FALLBACK_LOCALE] = $displayDescription[$key];
            unset( $displayDescription[$key] );
        }

        $this->displayDescription = $displayDescription;
        return $this;
    }
1233772
protected function addVariadicArgument(Method $data, MethodDescriptor $methodDescriptor): void
    {
        if (!$data->getDocBlock()) {
            return;
        }

        $paramTags = $data->getDocBlock()->getTagsByName('param');

        /** @var Param $lastParamTag */
        $lastParamTag = end($paramTags);
        if (!$lastParamTag) {
            return;
        }

        if ($lastParamTag->isVariadic()
            && array_key_exists($lastParamTag->getVariableName(), $methodDescriptor->getArguments()->getAll())
        ) {
            $types = $lastParamTag->getType();

            $argument = new ArgumentDescriptor();
            $argument->setName($lastParamTag->getVariableName());
            $argument->setType($types);
            $argument->setDescription($lastParamTag->getDescription());
            $argument->setLine($methodDescriptor->getLine());
            $argument->setVariadic(true);

            $methodDescriptor->getArguments()->set($argument->getName(), $argument);
        }
    }
1074770
public static function create($function_name, $parameters = NULL) {
    /** @var FunctionDeclarationNode $function */
    $function = Parser::parseSnippet("function $function_name() {}");
    if (is_array($parameters)) {
      foreach ($parameters as $parameter) {
        if (is_string($parameter)) {
          $parameter = ParameterNode::create($parameter);
        }
        $function->appendParameter($parameter);
      }
    }
    return $function;
  }
155437
def method_descriptor(descriptor: str) -> MethodDescriptor:
    
    end_para = descriptor.find(')')
    returns = descriptor[end_para + 1:]
    args = descriptor[1:end_para]

    return MethodDescriptor(
        parse_descriptor(returns)[0],
        parse_descriptor(args),
        returns,
        args,
        descriptor
    )
907482
public static function getDescriptions($function_name)
    {
        if (is_string($function_name))
            $reflection = new ReflectionFunction($function_name);
        elseif (is_array($function_name))
            $reflection = new ReflectionMethod($function_name[0], $function_name[1]);
        else
            throw new LogicException();

        $comment = $reflection->getDocComment();

        $lines = explode("\n", $comment);
        $obj = new self($lines);

        return array(trim($obj->short_desc), trim($obj->long_desc));
    }
921298
def describe_function(FunctionName, region=None, key=None,
                      keyid=None, profile=None):
    '''
    

    '''

    try:
        func = _find_function(FunctionName,
                              region=region, key=key, keyid=keyid, profile=profile)
        if func:
            keys = ('FunctionName', 'Runtime', 'Role', 'Handler', 'CodeSha256',
                    'CodeSize', 'Description', 'Timeout', 'MemorySize',
                    'FunctionArn', 'LastModified', 'VpcConfig', 'Environment')
            return {'function': dict([(k, func.get(k)) for k in keys])}
        else:
            return {'function': None}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
418026
protected function getListBuilder($entityName, $fieldDescriptors)
    {
        /** @var RestHelperInterface $restHelper */
        $restHelper = $this->get('sulu_core.doctrine_rest_helper');

        /** @var DoctrineListBuilderFactory $factory */
        $factory = $this->get('sulu_core.doctrine_list_builder_factory');

        $listBuilder = $factory->create($entityName);

        $restHelper->initializeListBuilder(
            $listBuilder,
            $fieldDescriptors
        );

        return $listBuilder;
    }
511195
public function compileFunction(CompilationContext $compilationContext, FunctionDefinition $functionDefinition)
    {
        /** Make sure we do not produce calls like ZEPHIR_CALL_SELF */
        $bakClassDefinition = $compilationContext->classDefinition;
        $compilationContext->classDefinition = null;
        $compilationContext->currentMethod = $functionDefinition;

        $codePrinter = $compilationContext->codePrinter;
        $codePrinter->output('PHP_FUNCTION('.$functionDefinition->getInternalName().') {');
        $functionDefinition->compile($compilationContext);
        $codePrinter->output('}');
        $codePrinter->outputBlankLine();

        /* Restore */
        $compilationContext->classDefinition = $bakClassDefinition;
        $compilationContext->currentMethod = null;
    }
756677
protected function generateWriteCallback(Entity $entity, FieldDescriptorProto $field)
    {
        $body  = [];
        $sttm  = $this->generateFieldWriteStatement($entity, $field);
        $lines = $this->addIndentation($sttm, 1);

        $body[] = '$writeCallback = function (\Protobuf\WriteContext $context, $value) {';
        $body[] = '    $stream      = $context->getStream();';
        $body[] = '    $writer      = $context->getWriter();';
        $body[] = '    $sizeContext = $context->getComputeSizeContext();';
        $body[] = null;
        $body   = array_merge($body, $lines);
        $body[] = '};';

        return $body;
    }
683473
protected function getJoinpointInvocationBody(ReflectionFunction $function): string
    {
        $class = '\\' . __CLASS__;

        $argumentList = new FunctionCallArgumentListGenerator($function);
        $argumentCode = $argumentList->generate();

        $return = 'return ';
        if ($function->hasReturnType()) {
            $returnType = (string) $function->getReturnType();
            if ($returnType === 'void') {
                // void return types should not return anything
                $return = '';
            }
        }

        $functionAdvices = $this->advices[AspectContainer::FUNCTION_PREFIX][$function->name];
        $advicesArray    = new ValueGenerator($functionAdvices, ValueGenerator::TYPE_ARRAY_SHORT);
        $advicesArray->setArrayDepth(1);
        $advicesCode = $advicesArray->generate();

        return <<<BODY
static \$__joinPoint;
if (\$__joinPoint === null) {
    \$__joinPoint = {$class}::getJoinPoint('{$function->name}', {$advicesCode});
}
{$return}\$__joinPoint->__invoke($argumentCode);
BODY;
    }
197698
function getFunctionCalls(call, functionRE) {
  var expressions = []

  var fnRE = typeof functionRE === "string" ? new RegExp("\\b(" + functionRE + ")\\(") : functionRE
  do {
    var searchMatch = fnRE.exec(call)
    if (!searchMatch) {
      return expressions
    }
    if (searchMatch[1] === undefined) {
      throw new Error("Missing the first couple of parenthesis to get the function identifier in " + functionRE)
    }
    var fn = searchMatch[1]
    var startIndex = searchMatch.index
    var matches = balanced("(", ")", call.substring(startIndex))

    if (!matches || matches.start !== searchMatch[0].length - 1) {
      throw new SyntaxError(fn + "(): missing closing ')' in the value '" + call + "'")
    }

    expressions.push({matches: matches, functionIdentifier: fn})
    call = matches.post
  }
  while (fnRE.test(call))

  return expressions
}
171692
public function callFunction($functionName, $parameters)
    {
        if ($functionName == 'getList') {
            $oObject = $this->getObject();
            $mResponse = $this->_formArrayFromList($oObject->getList());
        } else {
            $mResponse = parent::callFunction($functionName, $parameters);
        }

        return $mResponse;
    }
538371
public function getMethodDescription(): ?string
    {
        // Remove the comment markers
        $description = preg_replace('~\*/$~', '', $this->comment);
        $description = preg_replace('~^\s*(/\*\*|\* ?|\*/)~m', '', $description);

        // Keep everything before the first annotation
        $description = trim(explode('@', $description)[0]);

        // Drop common "Get" or "Return" in front of comment
        $description = ucfirst(preg_replace('~^(set|get|return)s? ~i', '', $description));

        return $description ?: null;
    }