Automatically generated run method

@param Request $request
@param PayloadInterface $payload
@return Response
349548
public function run(Request $request, PayloadInterface $payload = null) {
		$prefs = $this->getServiceContainer()->getPreferenceLoader()->getSystemPreferences();

		$data = [
			'prefs' => [
				'user_names' => $prefs->getUserNames(),
				'email' => $prefs->getUserEmail(),
				'sex' => $prefs->getUserSex(),
				'birth' => $prefs->getUserBirth(),
				'nick_name' => $prefs->getUserNickname(),
				'display_name' => $prefs->getUserDisplayName(),
				'display_option_given_family' => $prefs->getUserDisplayOptionGivenFamilyName(),
				'display_option_family_given' => $prefs->getUserDisplayOptionFamilyGivenName(),
				'display_option_username' => $prefs->getUserDisplayOptionUsername(),
				'display_option_nickname' => $prefs->getUserDisplayOptionNickname(),
				'display_given_family' => SystemPreferences::DISPLAY_GIVENFAMILYNAME,
				'display_family_given' => SystemPreferences::DISPLAY_FAMILYGIVENNAME,
				'display_nickname' => SystemPreferences::DISPLAY_NICKNAME,
				'display_username' => SystemPreferences::DISPLAY_USERNAME
			],
			'nickname_label' => $prefs->getUserNames() != SystemPreferences::VALUE_NONE ? 'nick_name' : 'name',
			'target' => $request->getUri(),
			'submitted' => $request->isMethod('POST'),
			'success' => $payload instanceof Updated
		];
		return new Response($this->render('/keeko/account/templates/profile.twig', $data));
	}
802122
public function run(Request $request) {
		$params = new Parameters($request->query->all());
		$domain = new FunctionPhaseDomain($this->getServiceContainer());
		$payload = $domain->paginate($params);
		return $this->responder->run($request, $payload);
	}
604417
public function run(ServerRequestInterface $request): void
    {
        $this->emitter->emit(
            $this->middleware->handle($request)
        );
    }
1108357
public function sendPayload($payload, $callback)
    {
        if (!is_string($payload)) {
            throw new \InvalidArgumentException('Payload must be string.');
        }

        try {
            $res = $this->client->post($this->host, [
                'headers' => [
                    'content-type' => 'application/json'
                ],
                'body' => $payload,
                'timeout' => $this->timeout,
                'connect_timeout' => $this->timeout
            ]);
            /**
             * @var StreamInterface $stream ;
             */
            $stream = $res->getBody();
            $json = json_decode($stream);
            $stream->close();

            if (JSON_ERROR_NONE !== json_last_error()) {
                call_user_func($callback, new InvalidArgumentException('json_decode error: ' . json_last_error_msg()), null);
            }
            if (is_array($json)) {
                // batch results
                $results = [];
                $errors = [];

                foreach ($json as $result) {
                    if (property_exists($result,'result')) {
                        $results[] = $result->result;
                    } else {
                        if (isset($json->error)) {
                            $error = $json->error;
                            $errors[] = new RPCException(mb_ereg_replace('Error: ', '', $error->message), $error->code);
                        } else {
                            $results[] = null;
                        }
                    }
                }
                if (count($errors) > 0) {
                    call_user_func($callback, $errors, $results);
                } else {
                    call_user_func($callback, null, $results);
                }
            } elseif (property_exists($json,'result')) {
                call_user_func($callback, null, $json->result);
            } else {
                if (isset($json->error)) {
                    $error = $json->error;

                    call_user_func($callback, new RPCException(mb_ereg_replace('Error: ', '', $error->message), $error->code), null);
                } else {
                    call_user_func($callback, new RPCException('Something wrong happened.'), null);
                }
            }
        } catch (RequestException $err) {
            call_user_func($callback, $err, null);
        }
    }
831071
public function call(string $method, $payload, int $flags = 0)
    {
        $this->relay->send(
            $method . pack("P", $this->seq),
            Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW
        );

        if ($flags & Relay::PAYLOAD_RAW) {
            $this->relay->send($payload, $flags);
        } else {
            $body = json_encode($payload);
            if ($body === false) {
                throw new Exceptions\ServiceException(sprintf(
                    "json encode: %s",
                    json_last_error_msg()
                ));
            }

            $this->relay->send($body);
        }

        $body = $this->relay->receiveSync($flags);

        if (!($flags & Relay::PAYLOAD_CONTROL)) {
            throw new Exceptions\TransportException("rpc response header is missing");
        }

        $rpc = unpack("Ps", substr($body, -8));
        $rpc['m'] = substr($body, 0, -8);

        if ($rpc["m"] != $method || $rpc["s"] != $this->seq) {
            throw new Exceptions\TransportException("rpc method call mismatch");
        }

        // request id++
        $this->seq++;

        // wait for the response
        $body = $this->relay->receiveSync($flags);

        return $this->handleBody($body, $flags);
    }
211225
public function run(Request $request) {
    // process the requested action
    ObjectFactory::getInstance('actionMapper')->processAction($request, $this->response);
    return $this->response;
  }
341079
function post($payload)
    {
        $this->requestDecorator->setPayload($payload);
        $result = $this->client->post($this->requestDecorator->makeResource(), $this->requestDecorator->makePayload(), $this->requestDecorator->makeHeaders());
        $this->refresh();
        return $result;
    }
683142
@RequestMapping(method = POST)
    public void handle(@Valid @RequestBody P payload) {
        logger.debug("{} handlers", handlers.size());
        for (H handler : handlers) {
            executor.execute(runnableHandler(handler, payload));
        }
    }
169303
public function process(Payload $payload) {
		$directory = $this->getDirectorySettingOrFail();
		$branch = $this->getSettingValue(self::OPTION_BRANCH, $payload->getRepository()->getMasterBranch());
		$url = $this->getSettingValue(self::OPTION_REPOSITORY, $payload->getRepository()->getUrl());
		$git = $this->resolveGitCommand();
		$command = array(
			'cd', escapeshellarg($directory), '&&',
			$git, self::COMMAND, escapeshellarg($url), escapeshellarg($branch)
		);
		if (TRUE === (boolean) $this->getSettingValue(self::OPTION_REBASE, FALSE)) {
			$command[] = self::COMMAND_REBASE;
		}
		$output = $this->executeGitCommand($command);
		$payload->getResponse()->addOutputFromPlugin($this, $output);
	}
365588
public function run( RequestInterface $request, $arguments ) {
		return $this->executeMiddleware( $this->middleware, $request, function () use ( $arguments ) {
			return call_user_func_array( [$this->getHandler(), 'execute'], $arguments );
		} );
	}
624894
public function handle(ServerRequestInterface $request): ResponseInterface
    {
        $input = $this->input($request);

        $payload = $this->domain->payload($input);

        return $this->responder->response($request, $payload);
    }
884231
private function respond(Request $request, string $buffer): \Generator
    {
        try {
            $method = $request->getMethod();

            if (!\in_array($method, $this->options->getAllowedMethods(), true)) {
                if (!\in_array($method, HttpDriver::KNOWN_METHODS, true)) {
                    $response = yield from $this->makeNotImplementedResponse();
                } else {
                    $response = yield from $this->makeMethodNotAllowedResponse();
                }
            } elseif ($method === "OPTIONS" && $request->getUri()->getPath() === "") {
                $response = $this->makeOptionsResponse();
            } else {
                $response = yield $this->requestHandler->handleRequest(clone $request);

                if (!$response instanceof Response) {
                    throw new \Error("At least one request handler must return an instance of " . Response::class);
                }
            }
        } catch (ClientException $exception) {
            $this->close();
            return;
        } catch (\Throwable $exception) {
            $this->logger->error($exception);
            $response = yield from $this->makeExceptionResponse($request);
        } finally {
            $this->pendingResponses--;
        }

        if ($this->status & self::CLOSED_WR) {
            return; // Client closed before response could be sent.
        }

        $promise = $this->httpDriver->write($request, $response);

        if ($response->isUpgraded()) {
            yield $promise; // Wait on writing response when the response is an upgrade response.
            $this->export($response->getUpgradeCallable(), $buffer);
        }
    }
311987
public function run(Request $request) {
		$body = Json::decode($request->getContent());
		if (!isset($body['data'])) {
			throw new InvalidParameterException();
		}
		$data = $body['data'];
		$id = $this->getParam('id');
		$domain = new ReferenceDomain($this->getServiceContainer());
		$payload = $domain->addSkill($id, $data);
		return $this->responder->run($request, $payload);
	}
703406
protected function run(Request $request)
	{
		// If there's nothing to dispatch, continue along the middleware pipeline
		$handler = $request->getAttribute('dispatch.handler', false);
		if ($handler === false) {
			return $this->chain($request);
		}

		// Setup any remaining chained parts of the dispatch for future dispatch
		$request = $request->withAttribute('dispatch.handler', $this->resolver->shift($handler));

		// Resolve the handler into something callable
		$dispatchable = $this->resolver->resolve($handler, $resolutionType);

		// Dispatch
		$parameters = [
			$dispatchable,
			$resolutionType,
			DispatchAdaptorInterface::SOURCE_DISPATCH_MIDDLEWARE,
			$request
		];
		$response = $this->getResponseObject();
		if ($response !== null) {
			$parameters[] = $response;
		}
		return $this->dispatcher->dispatch(...$parameters) ?: $this->chain($request);
	}
1328634
public function respondUpdatedWithPayload($payload = null, $message = "Updated")
    {
        $reponse = $this->setStatusCode(ResponseHTTP::HTTP_ACCEPTED)
            ->respondWithMessageAndPayload($payload, $message);
        return $reponse;
    }
324267
public function run(Request $request) {
		$page = $this->getServiceContainer()->getKernel()->getApplication()->getPage();
		$page->setTitle($this->getServiceContainer()->getTranslator()->trans('profile'));

		$payload = new Blank();
		if ($request->isMethod('POST')) {
			$post = $request->request;
			$user = $this->getServiceContainer()->getAuthManager()->getUser();
			$domain = new UserDomain($this->getServiceContainer());
			$serializer = User::getSerializer();

			$fields = $serializer->getFields();
			$fields[] = 'display_name_user_select';
			$attribs = [];

			foreach ($fields as $field) {
				if ($post->has($field)) {
					$attribs[$field] = $post->get($field);
				}
			}

			$payload = $domain->update($user->getId(), ['attributes' => $attribs]);
		}
		return $this->responder->run($request, $payload);
	}
88475
public function run(HttpRequest $request = null): Response
    {
        if ($request === null) {
            $request = HttpRequest::fromGlobals();
        }

        $this->httpRequest = $request;

        $context = new Context($request->getUri()->getPath(), $request);

        $response = $this->getHttpRouter()->route($context);

        if (!$response instanceof HttpResponse) {
            $response = new HttpResponse($response);
        }

        $this->flushResponse($request, $response);

        $this->httpRequest = null;

        return $response;
    }