Builds the processor that takes care
of setting contexts (e.g. HTTP and Auth context)
@return Processor
420905
protected function contextProcessor()
    {
        $components = $this->builder->components();

        $processors     = $components->processors();
        $httpProcessors = $components->httpProcessors();
        $authProcessors = $components->authProcessors();

        $context = $this->builder->context();

        return $processors->chain(array(
            $httpProcessors->updateContext($context),
            $authProcessors->updateContext($context),
        ));
    }
972474
public function createCore()
    {
        $config = new MemoryConfigCollection();

        // Set default middleware
        $config->setMiddlewares([
            new InheritanceMiddleware(Config::UNINHERITED),
            new ExtensionMiddleware(Config::EXCLUDE_EXTRA_SOURCES),
        ]);

        // Transform
        $config->transform([
            $this->buildStaticTransformer(),
            $this->buildYamlTransformer()
        ]);

        return $config;
    }
579299
public function build(): PauseOnAsyncCallRequest
	{
		$instance = new PauseOnAsyncCallRequest();
		if ($this->parentStackTraceId === null) {
			throw new BuilderException('Property [parentStackTraceId] is required.');
		}
		$instance->parentStackTraceId = $this->parentStackTraceId;
		return $instance;
	}
907831
public function build()
    {
        $uri = $this->trimTrailingSlashes($this->request->getUri()->getPath());
        $method = mb_strtoupper($this->request->getMethod());

        foreach ($this->routes[$method] as $routeUri => $action) {
            $arguments = $this->match($uri, $routeUri);

            if (!is_null($arguments)) {
                return $this->constructAction($action, $arguments);
            }
        }

        throw new HTTPException('Not found', 404);
    }
322378
public function createWriteContext()
    {
        $stream      = Stream::create();
        $writer      = $this->getStreamWriter();
        $sizeContext = $this->createComputeSizeContext();
        $context     = new WriteContext($stream, $writer, $sizeContext);

        return $context;
    }
545371
public function buildParserConfiguration()
    {
        if ($this->parserConfiguration === null) {
            $this->parserConfiguration = parent::buildParserConfiguration();
            $this->parserConfiguration->addInterceptor(new ResourceInterceptor());
        }

        return $this->parserConfiguration;
    }
281894
public function resolve($processor)
    {
        $middlewares = array($processor);

        foreach ($this->specs as $spec) {
            $args = $spec;
            $firstArg = array_shift($args);

            if (is_callable($firstArg)) {
                $processor = $firstArg($processor);
            } else {
                $kernelClass = $firstArg;
                array_unshift($args, $processor);

                $reflection = new \ReflectionClass($kernelClass);
                $processor = $reflection->newInstanceArgs($args);
            }

            array_unshift($middlewares, $processor);
        }

        return new StackedProcessor($processor, $middlewares);
    }
1116899
@Override
    protected BasicHttpProcessor createHttpProcessor() {
        BasicHttpProcessor httpproc = new BasicHttpProcessor();
        httpproc.addInterceptor(new RequestDefaultHeaders());
        // Required protocol interceptors
        httpproc.addInterceptor(new RequestContent(true));
        httpproc.addInterceptor(new RequestTargetHost());
        // Recommended protocol interceptors
        httpproc.addInterceptor(new RequestClientConnControl());
        httpproc.addInterceptor(new RequestUserAgent());
        httpproc.addInterceptor(new RequestExpectContinue());
        // HTTP state management interceptors
        httpproc.addInterceptor(new RequestAddCookies());
        httpproc.addInterceptor(new ResponseProcessCookies());
        // HTTP authentication interceptors
        httpproc.addInterceptor(new RequestAuthCache());
        httpproc.addInterceptor(new RequestTargetAuthentication());
        httpproc.addInterceptor(new RequestProxyAuthentication());
        return httpproc;
    }
980752
private static function processor(ContainerInterface $container): ProcessorInterface
    {
        if (!$container->has(ProcessorInterface::class)) {
            return new WebProcessor($container);
        }

        return $container->get(ProcessorInterface::class);
    }
164585
protected function dispatchProcessor()
    {
        $processors          = $this->builder->components()->processors();
        $frameworkProcessors = $this->builder->processors();

        return $processors->chain(array(
            $this->builder->configuration()->httpProcessor(),
            $frameworkProcessors->httpNormalizeResponse(),
        ));
    }
220807
public static function &processors()
    {
        if (!self::$processors) {
            // Add default processors.
            self::$processors = [
                new MergeIntoOpenApi(),
                new MergeIntoComponents(),
                new ImportTraits(),
                new AugmentSchemas(),
                new AugmentProperties(),
                new BuildPaths(),
                // new HandleReferences(),

                new InheritProperties(),
                new AugmentOperations(),
                new AugmentParameters(),
                new MergeJsonContent(),
                new MergeXmlContent(),
                new OperationId(),
                new CleanUnmerged(),
            ];
        }

        return self::$processors;
    }
370391
public function process()
    {
        if (isset($this->initialized['process'])) {
            return;
        }

        // Initialize Grav if needed.
        $this->setup();

        $this->initialized['process'] = true;

        $container = new Container(
            [
                'configurationProcessor' => function () {
                    return new ConfigurationProcessor($this);
                },
                'loggerProcessor' => function () {
                    return new LoggerProcessor($this);
                },
                'errorsProcessor' => function () {
                    return new ErrorsProcessor($this);
                },
                'debuggerProcessor' => function () {
                    return new DebuggerProcessor($this);
                },
                'initializeProcessor' => function () {
                    return new InitializeProcessor($this);
                },
                'backupsProcessor' => function () {
                    return new BackupsProcessor($this);
                },
                'pluginsProcessor' => function () {
                    return new PluginsProcessor($this);
                },
                'themesProcessor' => function () {
                    return new ThemesProcessor($this);
                },
                'schedulerProcessor' => function () {
                    return new SchedulerProcessor($this);
                },
                'requestProcessor' => function () {
                    return new RequestProcessor($this);
                },
                'tasksProcessor' => function () {
                    return new TasksProcessor($this);
                },
                'assetsProcessor' => function () {
                    return new AssetsProcessor($this);
                },
                'twigProcessor' => function () {
                    return new TwigProcessor($this);
                },
                'pagesProcessor' => function () {
                    return new PagesProcessor($this);
                },
                'debuggerAssetsProcessor' => function () {
                    return new DebuggerAssetsProcessor($this);
                },
                'renderProcessor' => function () {
                    return new RenderProcessor($this);
                },
            ]
        );

        $default = function (ServerRequestInterface $request) {
            return new Response(404);
        };

        /** @var Debugger $debugger */
        $debugger = $this['debugger'];

        $collection = new RequestHandler($this->middleware, $default, $container);

        $response = $collection->handle($this['request']);

        $this->header($response);
        echo $response->getBody();

        $debugger->render();

        register_shutdown_function([$this, 'shutdown']);
    }
828056
public function build(): SetPageScaleFactorRequest
	{
		$instance = new SetPageScaleFactorRequest();
		if ($this->pageScaleFactor === null) {
			throw new BuilderException('Property [pageScaleFactor] is required.');
		}
		$instance->pageScaleFactor = $this->pageScaleFactor;
		return $instance;
	}
807377
public function build(): SetPausedRequest
	{
		$instance = new SetPausedRequest();
		if ($this->animations === null) {
			throw new BuilderException('Property [animations] is required.');
		}
		$instance->animations = $this->animations;
		if ($this->paused === null) {
			throw new BuilderException('Property [paused] is required.');
		}
		$instance->paused = $this->paused;
		return $instance;
	}
660191
protected function createProcessorIterator(ContextInterface $context)
    {
        $action = $context->getAction();
        $actionProcessors = [];
        $processors = $this->configProvider->getProcessors();
        if (!empty($processors[$action])) {
            $actionProcessors = $processors[$action];
        }

        return $this->processorIteratorFactory->createProcessorIterator(
            $actionProcessors,
            $context,
            $this->processorApplicableChecker,
            $this->processorFactory
        );
    }
1048609
protected function proxy() {
        if (!$this->context) {
            $this->context = new ExecutionContext(
                $this->version,
                $this->solution['flowSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
117711
public function build()
    {
        switch ($this->provider) {
            default:
            case Provider::RACKSPACE:
                $class = __NAMESPACE__ . '\\RackspaceFactory';
                break;
            case Provider::OPENSTACK:
                $class = __NAMESPACE__ . '\\OpenStackFactory';
                break;
        }

        return $this->buildFactory($class)->buildClient();
    }