<commit_before><?php

namespace Bkstg\CoreBundle\Controller;

use Bkstg\CoreBundle\Entity\Production;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

class ProductionController extends Controller
{
    /**
     * Read a production, simply redirects to the overview.
     *
     * @param  string                        $production_slug The production slug.
     * @param  AuthorizationCheckerInterface $auth            The authorization checker service.
     * @throws NotFoundHttpException                          When the production is not found.
     * @throws AccessDeniedException                          When the user doesn't have access to the production.
     * @return Response                                       The redirect response.
     */
    public function readAction(
        string $production_slug,
        AuthorizationCheckerInterface $auth
    ): RedirectResponse {
        // Lookup the production by production_slug.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['slug' => $production_slug])) {
            throw new NotFoundHttpException();
        }

        // Check permissions for this action.
        if (!$auth->isGranted('GROUP_ROLE_USER', $production)) {
            throw new AccessDeniedException();
        }

        // Redirect to the production overview.
        return new RedirectResponse($this->url_generator->generate('bkstg_production_overview', ['production_slug' => $production_slug]));
    }

    /**
     * Shows the production image and description, with block for timeline.
     *
     * @param  string                        $production_slug The production slug.
     * @param  AuthorizationCheckerInterface $auth            The authorization checker service.
     * @throws NotFoundHttpException                          When the production is not found.
     * @throws AccessDeniedException                          When the user doesn't have access to the production.
     * @return Response                                       The rendered response.
     */
    public function overviewAction(
        string $production_slug,
        AuthorizationCheckerInterface $auth<commit_msg>Coding standards.<commit_after><?php

namespace Bkstg\CoreBundle\Controller;

use Bkstg\CoreBundle\Entity\Production;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

class ProductionController extends Controller
{
    /**
     * Read a production, simply redirects to the overview.
     *
     * @param  string                        $production_slug The production slug.
     * @param  AuthorizationCheckerInterface $auth            The authorization checker service.
     * @throws NotFoundHttpException                          When the production is not found.
     * @throws AccessDeniedException                          When the user doesn't have access to the production.
     * @return Response                                       The redirect response.
     */
    public function readAction(
        string $production_slug,
        AuthorizationCheckerInterface $auth
    ): RedirectResponse {
        // Lookup the production by production_slug.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['slug' => $production_slug])) {
            throw new NotFoundHttpException();
        }

        // Check permissions for this action.
        if (!$auth->isGranted('GROUP_ROLE_USER', $production)) {
            throw new AccessDeniedException();
        }

        // Redirect to the production overview.
        return new RedirectResponse($this->url_generator->generate(
            'bkstg_production_overview',
            ['production_slug' => $production_slug]
        ));
    }

    /**
     * Shows the production image and description, with block for timeline.
     *
     * @param  string                        $production_slug The production slug.
     * @param  AuthorizationCheckerInterface $auth            The authorization checker service.
     * @throws NotFoundHttpException                          When the production is not found.
     * @throws AccessDeniedException                          When the user doesn't have access to the production.
     * @return Response                                       The rendered response.
     */
    public function overviewAction(
        string $production_slug,
        AuthorizationCheckerInterface $auth
{'fraction_non_alphanumeric': 0.07391993658343242, 'fraction_numerical': 0.0, 'mean_word_length': 2.340172071475844, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2996473', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1160, 'n_words': 325}