<commit_before><?php

namespace Turanct;

use Turanct\Shack\Sha;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

final class Shack implements HttpKernelInterface
{
    private $app;
    private $sha;

    public function __construct(HttpKernelInterface $app, Sha $sha)
    {
        $this->app = $app;
        $this->sha = $sha;
    }

    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
    {
        $response = $this->app->handle($request, $type, $catch);

        $sha = $this->sha->get();
        $response->headers->set('X-Shack-Sha', $sha);

        return $response;
    }
}
<commit_msg>Don't show anything if the sha is empty<commit_after><?php

namespace Turanct;

use Turanct\Shack\Sha;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

final class Shack implements HttpKernelInterface
{
    private $app;
    private $sha;

    public function __construct(HttpKernelInterface $app, Sha $sha)
    {
        $this->app = $app;
        $this->sha = $sha;
    }

    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
    {
        $response = $this->app->handle($request, $type, $catch);

        $sha = $this->sha->get();

        if (!empty($sha)) {
            $response->headers->set('X-Shack-Sha', $sha);
        }

        return $response;
    }
}

{'fraction_non_alphanumeric': 0.13354632587859425, 'fraction_numerical': 0.0, 'mean_word_length': 3.2439024390243905, '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': '4401539', 'n_tokens_mistral': 487, 'n_tokens_neox': 478, 'n_words': 105}