<commit_before><?php

namespace Puphpet\Controller;

use Puphpet\Controller;

use Puphpet\Domain;
use Silex\Application;
use Silex\ControllerCollection;
use Symfony\Component\HttpFoundation\Request;

class Front extends Controller
{
    public function connect(Application $app)
    {
        /** @var $controllers ControllerCollection */
        $controllers = $app['controllers_factory'];

        $controllers->get('/', [$this, 'indexAction'])
            ->bind('homepage');

        $controllers->post('/create', [$this, 'createAction'])
            ->bind('create');

        $controllers->get('/about', [$this, 'aboutAction'])
            ->bind('about');

        $controllers->get('/help', [$this, 'helpAction'])
            ->bind('help');

        $controllers->get('/github-btn', [$this, 'githubbtnAction'])
            ->bind('github-btn');

        return $controllers;
    }

    public function indexAction(Request $request, Application $app)
    {
        $editionName = $request->query->get('edition', 'default');

        $availableEditions = $app['editions'];

        // validate edition name
        // use fallback if invalid edition name is requested (better than throwing any error)
        if (!array_key_exists($editionName, $availableEditions)) {
            $editionName = $app['edition_default'];
        }

        // fill the edition entity with requested configuration
        /**@var $edition Domain\Configuration\Edition */
        $edition = $app['edition'];
        $edition->setConfiguration($availableEditions[$editionName]);

        return $this->twig()->render(
            'Front/index.html.twig',
            [
                'currentPage' => 'home',
                'timezones'   => \DateTimeZone::listIdentifiers(),
                'edition'     => $edition,
            ]
        );
    }

    public function aboutAction()
    {
        return $this->twig()->render(
            'Front/one-column.html.twig',
            [
                'currentPage' => 'about',
                'markdown'    => $this->parseMarkdown('Front/Markdown/about.md')
            ]
        );
    }

    public function helpAction()
    {
        return $this->twig()->render(
            'Front/help.html.twig',
            [
                'currentPage' => 'help',
                'markdown'    => $this->parseMarkdown('Front/Markdown/help.md')<commit_msg>Should be using one-column template<commit_after><?php

namespace Puphpet\Controller;

use Puphpet\Controller;

use Puphpet\Domain;
use Silex\Application;
use Silex\ControllerCollection;
use Symfony\Component\HttpFoundation\Request;

class Front extends Controller
{
    public function connect(Application $app)
    {
        /** @var $controllers ControllerCollection */
        $controllers = $app['controllers_factory'];

        $controllers->get('/', [$this, 'indexAction'])
            ->bind('homepage');

        $controllers->post('/create', [$this, 'createAction'])
            ->bind('create');

        $controllers->get('/about', [$this, 'aboutAction'])
            ->bind('about');

        $controllers->get('/help', [$this, 'helpAction'])
            ->bind('help');

        $controllers->get('/github-btn', [$this, 'githubbtnAction'])
            ->bind('github-btn');

        return $controllers;
    }

    public function indexAction(Request $request, Application $app)
    {
        $editionName = $request->query->get('edition', 'default');

        $availableEditions = $app['editions'];

        // validate edition name
        // use fallback if invalid edition name is requested (better than throwing any error)
        if (!array_key_exists($editionName, $availableEditions)) {
            $editionName = $app['edition_default'];
        }

        // fill the edition entity with requested configuration
        /**@var $edition Domain\Configuration\Edition */
        $edition = $app['edition'];
        $edition->setConfiguration($availableEditions[$editionName]);

        return $this->twig()->render(
            'Front/index.html.twig',
            [
                'currentPage' => 'home',
                'timezones'   => \DateTimeZone::listIdentifiers(),
                'edition'     => $edition,
            ]
        );
    }

    public function aboutAction()
    {
        return $this->twig()->render(
            'Front/one-column.html.twig',
            [
                'currentPage' => 'about',
                'markdown'    => $this->parseMarkdown('Front/Markdown/about.md')
            ]
        );
    }

    public function helpAction()
    {
        return $this->twig()->render(
            'Front/one-column.html.twig',
            [
                'currentPage' => 'help',
                'markdown'    => $this->parseMarkdown('Front/Markdown/help.md')
{'fraction_non_alphanumeric': 0.15083333333333335, 'fraction_numerical': 0.0, 'mean_word_length': 2.1523309258043337, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '5264810', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1300, 'n_words': 247}