Dinamicaly calls method

@return mixed

@throws Koine\NoMethodError
19836
final public function __send()
    {
        $args   = func_get_args();
        $method = array_shift($args);

        if ($this->__respondTo($method)) {
            return call_user_func_array(array($this, $method), $args);
        }

        $message = new KoineString("Undefined method '");
        $message->append($method)->append("' for ")->append($this->getClass());
        throw new NoMethodException($message);
    }
969737
public function execute($callable, array $args = [], $context = null)
    {
        if ($callable instanceof \Closure) {
            $ref = new \ReflectionObject($callable);

            $args = $this->getMethodArgs($ref->getMethod('__invoke'), $args);
        } else {
            if (is_string($callable)) {
                $callable = explode('::', $callable);
            }

            list($object, $method) = $callable;

            $ref = new \ReflectionClass($object);

            $args = $this->getMethodArgs($ref->getMethod($method), $args);
        }

        $closure = function () use ($args, $callable) {
            switch (count($args)) {
                case 0:
                    return $callable();
                case 1:
                    return $callable($args[0]);
                case 2:
                    return $callable($args[0], $args[1]);
                case 3:
                    return $callable($args[0], $args[1], $args[2]);
                case 4:
                    return $callable($args[0], $args[1], $args[2], $args[3]);
                default:
                    return call_user_func_array($callable, $args);
            }
        };

        if ($context) {
            $closure = $closure->bindTo($context, $context);
        }

        return $closure();
    }
1282053
public function callMe()
    {
        $output = $this->dispatchStartEvent();

        /** @var \Brainworxx\Krexx\Service\Reflection\ReflectionClass $ref */
        $ref = $this->parameters[static::PARAM_REF];
        $refProps = $ref->getProperties(\ReflectionProperty::IS_PROTECTED);
        if (empty($refProps) === true) {
            return $output;
        }

        usort($refProps, array($this, 'reflectionSorting'));

        return $output .
            $this->getReflectionPropertiesData(
                $refProps,
                $ref,
                'Protected properties'
            );
    }
145815
public function activate(): void
    {
        if ($this->stopBuffering) {
            $this->buffering = false;
        }
        if (!$this->handler instanceof HandlerInterface) {
            $record = end($this->buffer) ?: null;

            $this->handler = call_user_func($this->handler, $record, $this);
            if (!$this->handler instanceof HandlerInterface) {
                throw new \RuntimeException("The factory callable should return a HandlerInterface");
            }
        }
        $this->handler->handleBatch($this->buffer);
        $this->buffer = [];
    }
603769
public function call()
    {
        $ch = curl_init();
        curl_setopt_array($ch, [
            CURLOPT_URL            => $this->getApiUrl().'?'.http_build_query($this->getOptions()),
            CURLOPT_HEADER         => 0,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT        => $this->timeout,
        ]);
        $this->response = curl_exec($ch);
        curl_close($ch);

        return $this;
    }
520568
public function dispatch()
    {
        $handler = [$this->controller, 'initialize'];
        if (method_exists($this->controller, 'initialize') && is_callable($handler)) {
            call_user_func($handler);
        }

        $this->isCallableOrException();

        return call_user_func_array([$this->controller, $this->action], $this->params);
    }
839628
public function dispatch ($method, $args = array())
		{
			if (is_callable(array($this, $method))) {
				$response = call_user_func_array(
					array($this, $method),
					$args
				);
			} else {
				throw new InvalidMethodException('Invalid controller method ' . $method);
			}

			if ($response instanceof Response) {
				return $response;
			} else if (is_string($response)) {
				return new StringResponse($response);
			} else {
				throw new InvalidResponseException('Invalid response.');
			}
		}
1028039
public function callMe()
    {
        $output = $this->dispatchStartEvent();

        $recursionMarker = $this->pool->recursionHandler->getMarker();
        $output .= $this->pool->render->renderSingeChildHr();
        $multiline = $this->parameters[static::PARAM_MULTILINE];

        // Iterate through.
        foreach ($this->parameters[static::PARAM_DATA] as $key => &$value) {
            // We will not output our recursion marker.
            // Meh, the only reason for the recursion marker
            // in arrays is because of the $GLOBAL array, which
            // we will only render once.
            if ($key === $recursionMarker) {
                continue;
            }

            /** @var Model $model */
            $model = $this->pool->createClass('Brainworxx\\Krexx\\Analyse\\Model');

            // Are we dealing with multiline code generation?
            if ($multiline === true) {
                // Here we tell the Codegen service that we need some
                // special handling.
                $model->setMultiLineCodeGen(Codegen::ITERATOR_TO_ARRAY);
            }

            // Handling string keys of the array.
            $this->handleKey($key, $model);
            // Handling of the value and add some output.
            $output .= $this->handleValue($value, $model);
        }

        return $output . $this->pool->render->renderSingeChildHr();
    }
80480
private function executeCall()
    {
        $call = $this->call;
        list($results, $shouldContinue) = $this->mapResults(
            $call($this->callOptions)
        );

        $this->set(
            $this->resultTokenPath,
            $this->callOptions,
            $this->determineNextResultToken($results, $shouldContinue)
        );

        return $results;
    }
475002
public function callMe()
    {
        // We are handling the following values here:
        // file, line, function, object, type, args, sourcecode.
        return $this->dispatchStartEvent() .
            $this->fileToOutput() .
            $this->lineToOutput() .
            $this->functionToOutput() .
            $this->objectToOutput() .
            $this->typeToOutput() .
            $this->argsToOutput();
    }
1250828
public function call()
    {
        switch ( Request::input( 'do' , false) ) {
            case 'init':
                return $this->init();
            case 'finish':
                return $this->finish();
            case 'notify':
                return $this->notify();
        }
    }
656677
public function call()
    {
        $host = $this->getHost();
        if (!$host || empty($host)) {
            throw new InvalidArgumentException('Host não informado');
        }

        $service = $this->getService();
        if (!$service || empty($service)) {
            throw new InvalidArgumentException('Serviço não informado');
        }

        $request = $this->getRequest();
        if (!$request || empty($request)) {
            throw new InvalidArgumentException('Request não informada');
        }

        $this->connect();
        $client = $this->getClient();

        return $client->__soapCall($service, $request);
    }
807917
public function callAction($method, array $parameters = [])
    {
        $isAjax = app()->make('request')->ajax();

        $method = $this->checkAjaxMethod($method, $isAjax);
        $parameters = $this->checkParametersResolving($method, $parameters);

        return parent::callAction($method, $parameters);
    }
1264366
public static function handleRequest()
    {
        // save static class
        static::$calledClass = get_called_class();

        // handle JSON requests
        if (static::peekPath() == 'json') {
            // check access for API response modes
            static::$responseMode = static::shiftPath();
            if (in_array(static::$responseMode, ['json','jsonp'])) {
                if (!static::checkAPIAccess()) {
                    return static::throwAPIUnAuthorizedError();
                }
            }
        }

        return static::handleRecordsRequest();
    }
323844
public function init()
    {
        foreach ($this->dynamic as $key => $data) {
            // Locate field.
            $path = explode('/', $key);
            $current = &$this->items;

            foreach ($path as $field) {
                if (\is_object($current)) {
                    // Handle objects.
                    if (!isset($current->{$field})) {
                        $current->{$field} = [];
                    }

                    $current = &$current->{$field};
                } else {
                    // Handle arrays and scalars.
                    if (!\is_array($current)) {
                        $current = [$field => []];
                    } elseif (!isset($current[$field])) {
                        $current[$field] = [];
                    }

                    $current = &$current[$field];
                }
            }

            // Set dynamic property.
            foreach ($data as $property => $call) {
                $action = 'dynamic' . ucfirst($call['action']);

                if (method_exists($this, $action)) {
                    $this->{$action}($current, $property, $call);
                }
            }
        }

        return $this;
    }
1371283
private function invokeCallback($method_name, $must_exist=true)
	{
		return static::table()->callback->invoke($this,$method_name,$must_exist);
	}
231565
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
    {
        $this->currentUri = $this->prepareUrlForRequest($uri);

        $symfonyRequest = SymfonyRequest::create(
            $this->currentUri, $method, $parameters,
            $cookies, $files, $server, $content
        );

        $response = $this->app->prepareResponse(
            $this->app->handle(Request::createFromBase($symfonyRequest))
        );
        $this->response = $this->createTestResponse($response);

        return $this->response;
    }