<commit_before><?php

namespace Drupal\wmcontroller\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Controller\ControllerResolverInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\wmcontroller\Service\Cache\Dispatcher;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class FrontController extends ControllerBase
{
    /** @var ArgumentResolverInterface */
    protected $argumentResolver;

    /** @var ControllerResolverInterface */
    protected $controllerResolver;

    /** @var Request */
    protected $request;

    /** @var Dispatcher */
    protected $dispatcher;

    /** @var array */
    protected $settings;

    protected $throw404WhenNotTranslated = true;

    public function __construct(
        ArgumentResolverInterface $argumentResolver,
        ControllerResolverInterface $controllerResolver,
        Dispatcher $dispatcher,
        array $settings
    ) {
        $this->argumentResolver = $argumentResolver;
        $this->dispatcher = $dispatcher;
        $this->controllerResolver = $controllerResolver;
        $this->settings = $settings;

        if (isset($this->settings['404_when_not_translated'])) {
            $this->throw404WhenNotTranslated = $this->settings['404_when_not_translated'];
        }
    }

    public static function create(ContainerInterface $container)
    {
        return new static(
            $container->get('http_kernel.controller.argument_resolver'),
            $container->get('controller_resolver'),
            $container->get('wmcontroller.cache.dispatcher'),
            $container->getParameter('wmcontroller.settings'),
        );
    }

    public function term(Request $request, EntityInterface $taxonomy_term)
    {
        return $this->forward($request, $taxonomy_term);
    }

    public function node(Request $request, EntityInterface $node)
    {
        return $this->forward($request, $node);
    }
<commit_msg>Fix syntax error on PHP versions lower than 7.3<commit_after><?php

namespace Drupal\wmcontroller\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Controller\ControllerResolverInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\wmcontroller\Service\Cache\Dispatcher;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class FrontController extends ControllerBase
{
    /** @var ArgumentResolverInterface */
    protected $argumentResolver;

    /** @var ControllerResolverInterface */
    protected $controllerResolver;

    /** @var Request */
    protected $request;

    /** @var Dispatcher */
    protected $dispatcher;

    /** @var array */
    protected $settings;

    protected $throw404WhenNotTranslated = true;

    public function __construct(
        ArgumentResolverInterface $argumentResolver,
        ControllerResolverInterface $controllerResolver,
        Dispatcher $dispatcher,
        array $settings
    ) {
        $this->argumentResolver = $argumentResolver;
        $this->dispatcher = $dispatcher;
        $this->controllerResolver = $controllerResolver;
        $this->settings = $settings;

        if (isset($this->settings['404_when_not_translated'])) {
            $this->throw404WhenNotTranslated = $this->settings['404_when_not_translated'];
        }
    }

    public static function create(ContainerInterface $container)
    {
        return new static(
            $container->get('http_kernel.controller.argument_resolver'),
            $container->get('controller_resolver'),
            $container->get('wmcontroller.cache.dispatcher'),
            $container->getParameter('wmcontroller.settings')
        );
    }

    public function term(Request $request, EntityInterface $taxonomy_term)
    {
        return $this->forward($request, $taxonomy_term);
    }

    public function node(Request $request, EntityInterface $node)
    {
        return $this->forward($request, $node);
    }

{'fraction_non_alphanumeric': 0.10464844662462042, 'fraction_numerical': 0.006073347348750292, 'mean_word_length': 3.574786324786325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '6868691', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1060, 'n_words': 206}