<commit_before><?php
/**
 * Created by PhpStorm.
 * User: manuelmeister
 * Date: 14.05.15
 * Time: 00:25
 */

namespace ThePost\Controller;


use ThePost\Model\Model;
use ThePost\Model\Repository\EntryRepository;
use ThePost\View\FrontView;
use ThePost\View\View;

/**
 * Class DefaultController
 * @package ThePost\Controller
 */
class DefaultController {

    /**
     * @var Model
     */
    protected $model;

    /**
     * @var View
     */
    protected $view;

    /**
     * @var array
     */
    protected $options_array = array();

    /**
     * @param $model
     */
    function __construct($model)
    {
        $this->model = $model;

        $stmt = $this->model->pdo->prepare('SELECT * FROM Options;');
        $stmt->execute();
        $options = $stmt->fetchAll(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, 'ThePost\Model\Entity\Options');

        foreach ($options as $option) {
            /** @var ThePost/Model/Entity/Options $option */
            $this->options_array[$option->getKey()] = utf8_encode($option->getValue());
        }
    }

    public function front(){
        $entry_repository = new EntryRepository($this->model->pdo);
        $entries = $entry_repository->findAll();
        $this->view = new FrontView($entries,$this->options_array);
    }

}<commit_msg>Added param to front method<commit_after><?php
/**
 * Created by PhpStorm.
 * User: manuelmeister
 * Date: 14.05.15
 * Time: 00:25
 */

namespace ThePost\Controller;


use ThePost\Model\Model;
use ThePost\Model\Repository\EntryRepository;
use ThePost\View\FrontView;
use ThePost\View\View;

/**
 * Class DefaultController
 * @package ThePost\Controller
 */
class DefaultController {

    /**
     * @var Model
     */
    protected $model;

    /**
     * @var View
     */
    protected $view;

    /**
     * @var array
     */
    protected $options_array = array();

    /**
     * @param $model
     */
    function __construct($model)
    {
        $this->model = $model;

        $stmt = $this->model->pdo->prepare('SELECT * FROM Options;');
        $stmt->execute();
        $options = $stmt->fetchAll(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, 'ThePost\Model\Entity\Options');

        foreach ($options as $option) {
            /** @var ThePost/Model/Entity/Options $option */
            $this->options_array[$option->getKey()] = utf8_encode($option->getValue());
        }
    }

    public function front($param){
        $entry_repository = new EntryRepository($this->model->pdo);
        $entries = $entry_repository->findAll();
        $this->view = new FrontView($entries,$this->options_array);
    }

}
{'fraction_non_alphanumeric': 0.15891768292682926, 'fraction_numerical': 0.008384146341463415, 'mean_word_length': 2.54251012145749, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '660481', 'n_tokens_mistral': 835, 'n_tokens_neox': 805, 'n_words': 152}