<commit_before><?php
/**
 * Created by PhpStorm.
 * User: bwalkl
 * Date: 22.05.2015
 * Time: 08:07
 */

namespace ThePost\Controller\Output;

use ThePost\Model\Repository\OptionRepository;
use ThePost\View\SettingsView;

class SettingsController extends MainController {

    public function settings(){
        $options_repository = new OptionRepository($this->model->pdo);
        $options = $options_repository->findAll();
        $this->view = new SettingsView($options);
        $this->view->add_render_vars(array("site"=>array("settings"=>true)));
    }

    public function saveAll(){
        $options_repository = new OptionRepository($this->model->pdo);

        if(isset($_POST['settings'])){
            $settings = $_POST['settings'];
<commit_msg>Added PHPDocs<commit_after><?php
/**
 * Created by PhpStorm.
 * User: bwalkl
 * Date: 22.05.2015
 * Time: 08:07
 */

namespace ThePost\Controller\Output;

use ThePost\Model\Repository\OptionRepository;
use ThePost\View\SettingsView;

/**
 * Class SettingsController
 * @package ThePost\Controller\Output
 */
class SettingsController extends MainController {

    /**
     * Gets settings from options table and displays it via SettingsView
     */
    public function settings(){
        $options_repository = new OptionRepository($this->model->pdo);
        $options = $options_repository->findAll();
        $this->view = new SettingsView($options);
        $this->view->add_render_vars(array("site"=>array("settings"=>true)));
    }

    /**
     * Gets every $_POST['settings'] and updates the database
     */
    public function saveAll(){
        $options_repository = new OptionRepository($this->model->pdo);

        if(isset($_POST['settings'])){
            $settings = $_POST['settings'];

{'fraction_non_alphanumeric': 0.14366837024417944, 'fraction_numerical': 0.013628620102214651, 'mean_word_length': 3.564766839378238, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '6953017', 'n_tokens_mistral': 512, 'n_tokens_neox': 488, 'n_words': 104}