<commit_before><?php

/*
* This file is part of the OrbitaleCmsBundle package.
*
* (c) <NAME> <<EMAIL>>
* (c) <NAME> (@aimproxy) <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Orbitale\Bundle\CmsBundle\Controller;

use DateTime;
use Orbitale\Bundle\CmsBundle\Entity\Page;
use Orbitale\Bundle\CmsBundle\Repository\PageRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
 * Class PostsController
 * @package Orbitale\Bundle\CmsBundle\Controller
 */
class PostsController extends AbstractCmsController
{
    /**
     * @var Request
     */
    private $request;

    /**
     * @var PageRepository
     */
    private $pageRepository;

    public function __construct(PageRepository $pageRepository)
    {
        $this->pageRepository = $pageRepository;
    }

    /**
     * @param Request $request
     * @param string $slugs
     * @param string $date
     * @return Response
     */
    public function indexAction(Request $request, string $slugs = '',
                                string $date = '', string $_date_format = null,
                                string $_locale = null): Response
    {
        if (!$this->isValidDate($date, $_date_format)) {
            throw $this->createNotFoundException("Invalid Date format provided");
        }

        if (!$slugs || '/' === $slugs) {
            return $this->redirect($this->generateUrl('orbitale_cms_post',
                [
                    'date' => $date,
                    'slugs' => rtrim($slugs, '/')
                ]<commit_msg>Put args in one line as requested<commit_after><?php

/*
* This file is part of the OrbitaleCmsBundle package.
*
* (c) <NAME> <<EMAIL>>
* (c) <NAME> (@aimproxy) <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Orbitale\Bundle\CmsBundle\Controller;

use DateTime;
use Orbitale\Bundle\CmsBundle\Entity\Page;
use Orbitale\Bundle\CmsBundle\Repository\PageRepository;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
 * Class PostsController
 * @package Orbitale\Bundle\CmsBundle\Controller
 */
class PostsController extends AbstractCmsController
{
    /**
     * @var Request
     */
    private $request;

    /**
     * @var PageRepository
     */
    private $pageRepository;

    public function __construct(PageRepository $pageRepository)
    {
        $this->pageRepository = $pageRepository;
    }

    /**
     * @param Request $request
     * @param string $slugs
     * @param string $date
     * @return Response
     */
    public function indexAction(Request $request, string $slugs = '', string $date = '', string $_date_format = null, string $_locale = null): Response
    {
        if (!$this->isValidDate($date, $_date_format)) {
            throw $this->createNotFoundException("Invalid Date format provided");
        }

        if (!$slugs || '/' === $slugs) {
            return $this->redirect($this->generateUrl('orbitale_cms_post',
                [
                    'date' => $date,
                    'slugs' => rtrim($slugs, '/')
                ]
{'fraction_non_alphanumeric': 0.12386156648451731, 'fraction_numerical': 0.0, 'mean_word_length': 2.6089813800657176, 'pattern_counts': {'":': 0, '<': 17, '<?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': '218977', 'n_tokens_mistral': 931, 'n_tokens_neox': 911, 'n_words': 230}