<commit_before><?php

namespace League\Glide\Middlewares;

use League\Glide\Output;
use League\Glide\Server;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class ImageServer implements HttpKernelInterface
{
    /**
     * @var Server
     */
    private $server;

    /**
     * New Image Server Middleware
     * @param Server $server Configured instance of League\Glide\Server
     */
    public function __construct(Server $server)
    {
        $this->server = $server;
    }

    /**
     * {@inheritdoc}
     */
    public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
    {
        $imageRequest = $this->server->makeImage($request->getPathInfo(), $request->query->all());

        $output = new Output($this->server->getCache());
        $response = $output->getResponse($imageRequest->getHash());

        return $response;
    }
}<commit_msg>Simplify ImageServer middleware handle method.<commit_after><?php

namespace League\Glide\Middlewares;

use League\Glide\Server;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class ImageServer implements HttpKernelInterface
{
    /**
     * @var Server
     */
    private $server;

    /**
     * New Image Server Middleware
     * @param Server $server Configured instance of League\Glide\Server
     */
    public function __construct(Server $server)
    {
        $this->server = $server;
    }

    /**
     * {@inheritdoc}
     */
    public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
    {
        return $this->server->getImageResponse($request->getPathInfo(), $request->query->all());
    }
}
{'fraction_non_alphanumeric': 0.1288272674754477, 'fraction_numerical': 0.0, 'mean_word_length': 3.1435406698564594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5426758', 'n_tokens_mistral': 498, 'n_tokens_neox': 488, 'n_words': 105}