@param string     $name
@param array|null $parameters
@param int        $type

@return CallFunctionStatement
541289
public function functionCall($name, $parameters = null, $type = CallFunctionStatement::TYPE_CALL_DIRECT)
    {
        return new CallFunctionStatement($name, $parameters, $type);
    }
723141
public function argument($type, $name) {
        $argument = new Argument($type, $name);
        $this->addArgument($argument);

        return $argument;
    }
119633
private function getOption(array $options, $name, $default = null, callable $type = null)
    {
        if (array_key_exists($name, $options)) {
            $result = $options[$name];
        } else {
            $result = $default;
        }
        if ($type && !call_user_func($type, $result)) {
            throw new InvalidArgumentException(
                "The provided option for {$name}: " . print_r($result, true) . " is invalid"
            );
        }

        return $result;
    }
487651
public function &call($type, $method, $parameters = array())
	{
		$class = $this->get_class($type);

		if (in_array($class, $this->legacy))
		{
			switch ($type)
			{
				case 'Cache':
					// For backwards compatibility with old non-static
					// Cache::create() methods
					if ($method === 'get_handler')
					{
						$result = @call_user_func_array(array($class, 'create'), $parameters);
						return $result;
					}
					break;
			}
		}

		$result = call_user_func_array(array($class, $method), $parameters);
		return $result;
	}
942676
public function getPostOrQuery(string $name, string $type = null, $default = null)
    {
        $post = $this->getPost($name, $type, $default);
        if (!is_null($post)) {
            return $post;
        }

        return $this->getQuery($name, $type, $default);
    }
485738
public function renderTemplate($name, $type, array $parameters, $isInline)
    {
        switch ($type) {
            case 'style':
                $templateName = $this->getStyleTemplateName($name, $isInline);
                break;
            case 'tag':
            default:
                $templateName = $this->getTagTemplateName($name, $isInline);
        }

        if ($templateName === null) {
            $this->logger->error(
                "Could not render template {$type} '{$name}': no template configured"
            );

            return null;
        }

        if (!$this->templateEngine->exists($templateName)) {
            $this->logger->error(
                "Could not render template {$type} '{$name}': template '{$templateName}' does not exist"
            );

            return null;
        }

        return $this->render($templateName, $parameters);
    }
794930
public static function setter($name, $type)
  {
    $setter = self::method(
      'set' . ucfirst($name),
      [
        new ParameterGenerator($name, $type)
      ]
    );

    $setter->getDocBlock()->setTag(new GenericTag('return', 'static'));

    $body = "\$this->{$name} = \${$name};" . PHP_EOL
    . "return \$this;" . PHP_EOL;

    $setter->setBody($body);

    return $setter;
  }
315944
public function check($name, $parameters)
    {
        $parameters = func_get_args();

        // Remove $name
        array_shift($parameters);

        return call_user_func_array($this->conditions[$name], $parameters);
    }
780978
protected function _createListTerm( $name, $type )
	{
		switch( $this->getOperator() )
		{
			case '==':

				$list = array();
				foreach( (array) $this->getValue() as $value ) {
					$list[] = $this->_createTerm( $name, $type, $value );
				}
				return '( ' . implode( ' || ', $list ) . ' )';

			case '!=':

				$list = array();
				foreach( (array) $this->getValue() as $value ) {
					$list[] = $this->_createTerm( $name, $type, $value );
				}
				return '( ' . implode( ' && ', $list ) . ' )';

			default:
				throw new MW_Common_Exception( sprintf( 'List Term not allowed for operator "%1$s"', $this->getOperator() ) );
		}
	}
1147420
public function createAction($name, $type = null, array $options = [])
    {
        $this->preventIfLocked();

        if (null !== $type) {
            return $this->getFactory()->createActionBuilder($name, $type, $options);
        }

        throw new \InvalidArgumentException('Action type guessing is not yet supported.');
        // TODO return $this->getFormFactory()->createActionBuilderForProperty($this->getDataClass(), $name, $options);
    }
1071270
public function createFilter($name, $type = null, array $options = [])
    {
        $this->preventIfLocked();

        if (null !== $type) {
            return $this->getFactory()->createFilterBuilder($name, $type, $options);
        }

        throw new \InvalidArgumentException('Filter type guessing is not yet supported.');
        // TODO return $this->getFormFactory()->createFilterBuilderForProperty($this->getDataClass(), $name, $options);
    }
1360326
public static function func(
            $returnsReference,
            $name,
            array $parameterExpressions
    ) {
        return new self(
                self::TYPE_FUNCTION,
                $returnsReference,
                null,
                null,
                null,
                $name,
                $parameterExpressions,
                null);
    }
469470
public function bindParam($name, &$var, $type = PDO::PARAM_STR, $length = null)
    {
        return $this->stmt->bindParam($name, $var, $type, $length);
    }
543438
public function get($name = null, $default = null, $type = null)
    {
        $get = $this->request['get'];
        gplcart_array_trim($get, true);

        if (isset($name)) {
            $result = gplcart_array_get($get, $name);
            $return = isset($result) ? $result : $default;
        } else {
            $return = $get;
        }

        gplcart_settype($return, $type, $default);
        return $return;
    }
513760
protected function call(string $name, array $parameters)
    {
        $definition = $this->registrar->get($name);

        $parameters = array_prepend(array_values($parameters), $this);

        call_user_func_array($definition, $parameters);
    }
329997
public function get($type, $name)
    {
        return isset($this->clients[$type][$name]) ? $this->clients[$type][$name] : null;
    }
360413
public function getOption($name, $type = null)
    {
        $type = $type ?: $this->getTypeByName($name);
        if (!isset($this->options[$name]) && class_exists($name)) {
            $name = array_search($name, $this->mapping[$type]) ?: $name;
        }
        if (!isset($this->options[$name])) {
            $option = $this->createOption($name, $type);
            $name = $option->getName();
            $this->options[$name] = $option;
            if (!isset($this->mapping[$type][$name])) {
                $this->mapping[$type][$name] = get_class($option);
            }
        }

        return $this->options[$name];
    }