Turn a request into a response.

@param array $input
@return \FluxBB\Server\Response
425123
public function execute(array $input = [])
    {
        $this->input = $input;
        $data = $this->run();

        return new Response($data ?: []);
    }
986867
public function process(array $input)
    {
        if (!empty($input['q'])) {
            $this->searchQuery = $input['q'];
        }
        if (!empty($input['sort'])) {
            foreach (explode(',', $input['sort']) as $sort) {
                $this->processOrderByParams($sort);
            }
        }
        $input = $this->processPageParams($input);
        foreach ($input as $key => $param) {
            if (!in_array($key, ['sort', 'page', 'per_page', 'q'], true)) {
                $this->processFilterParams($key, $param);
            }
        }
        return $this;
    }
904751
protected function cleanInputData(array $input)
    {
        foreach ($input as $key => $value) {
            $const = get_called_class() . '::DIAGNOSTIC_' . strtoupper($key);
            if (defined($const)) {
                $data[constant($const)] = $value;
            }
        }
        if (empty($data)) {
            throw new StorageException('No data to insert into storage');
        }

        return $data;
    }
963618
public function open(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_OPEN] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
631119
protected static function parseInput(array $server, $input)
    {
        if (!$input) {
            return;
        }

        if (isset($server['CONTENT_TYPE']) && stripos($server['CONTENT_TYPE'], 'application/json') === 0) {
            return (array) json_decode($input, true) ?: null;
        }

        if (strtoupper($server['REQUEST_METHOD']) === 'PUT') {
            parse_str($input, $params);

            return (array) $params ?: null;
        }
    }
661556
public function prepare($input)
    {
        $form = $this->buildEmbeddedForm();

        return $form->setOriginal($this->original)->prepare($input);
    }
722259
public static function fromArray($input = [])
	{
		$fields = ScalarFields::getInstance();

		foreach ($input as $k => $v) {
			if (is_array($v)) {
				$fields = $fields->appendFields($k, self::fromArray($v));
			} elseif (!!$v) {
				$fields = $fields->appendField($k);
			}
		}

		return $fields;
	}
187222
protected function respond($response)
    {
        $success = Arr::get($response, 'success');

        return $this->mapResponse($success, $response);
    }
928031
public static function input(String $input) : Http
    {
        if( in_array($input, self::$types) )
        {
            self::$settings['input'] = $input;
        }
        else
        {
            throw new InvalidArgumentException('Error', 'invalidInput', $input.' : get, post, server, env, request');
        }

        return self::singleton();
    }
1069550
public function subscriberByRequest(array $input, array $headers): ?Subscriber
    {
        $channel = Arr::get($input, 'channel_name');

        return $channel
            ? $this->subscriberByChannel($channel)
            : null;
    }
118627
public function payload(array $input): PayloadInterface
    {
        $domain = $this->container->get($this->id);

        if ($domain instanceof DomainInterface) {

            return $domain->payload($input);

        }

        throw new ContainedDomainTypeException($this->id, $domain);
    }
1024386
public function process(array $input)
    {
        try
        {
            $success = $this->v->validate($input);
        }
        catch(ValidationException $e)
        {
            $this->setErrorsAndThrowException();
        }
        if( ! $success)
        {
            $this->setErrorsAndThrowException();
        }

        Event::fire("form.processing", array($input));
        return $this->callRepository($input);
    }
23005
public function parse(array $input)
    {
        $this->data = Arr::get($input, 'data');

        if ($this->data === null) {
            return null;
        }

        $this->included = Arr::get($input, 'included', []);
        $this->start();

        return $this->resolver->getResolved();
    }
96031
public function fetch(Input $input)
    {
        return $this->bus->handle(
            $this->messageCreator->create($this->query, $input)
        );
    }
1020891
public function asResponse($input, $status = self::OK, array $header = [])
    {
        return ResponseHelper::fill($this->response, $input, $status, $header);
    }
608407
public static function create(array $input = [])
    {
        DB::beginTransaction();

        try {
            LaravelEvent::fire(static::$name.'.creating');
            static::beforeCreate($input);
            $return = parent::create($input);
            static::afterCreate($input, $return);
            LaravelEvent::fire(static::$name.'.created');

            DB::commit();
        } catch (\Exception $e) {
            DB::rollBack();
            throw $e;
        }

        return $return;
    }
1189662
public function initialFormData($input)
    {
        if (is_array($input) && isset($input['id'])) {
            return IDEncoder::decode($input['id']);
        }

        return null;
    }