<commit_before><?php

/**
 * Created by Prowect
 * Author: <NAME>
 * Date: 02.04.2016 - 10:58.
 * Copyright Prowect.
 */

namespace Drips\MVC;

use Smarty;

/**
 * Class View.
 *
 * Stellt die View-Komponente des MVC-Systems dar. Basiert auf der Template-Engine
 * Smarty und implementiert somit alle zugehörigen Funktionen.
 * Für weitere Details siehe: http://www.smarty.net/docs/en/
 */
class View extends Smarty
{
    protected $tmp_dir = '.views';

    public function __construct(){
        parent::__construct();

        // configure smarty
        if(defined('DRIPS_TMP')){
            $this->tmp_dir = DRIPS_TMP.'/'.$this->tmp_dir;
        }
        $this->setTemplateDir(DRIPS_SRC.'/views/');
        $this->setCompileDir($this->tmp_dir.'/templates_c/');
        $this->setConfigDir($this->tmp_dir.'/configs/');
        $this->setCacheDir($this->tmp_dir.'/cache/');

        // Widget-Plugin registrieren
        $this->registerPlugin('function', 'widget', [$this, 'widgetPlugin']);
    }

    public function widgetPlugin($params, $view)
    {
        extract($params);
        if(isset($name)){
            if(class_exists($name)){
                $widget = new $name;
                if($widget instanceof IWidget){
                    return $widget->exec($params, $view);
                }
            }
        }
    }
}
<commit_msg>Testcases gefixt<commit_after><?php

/**
 * Created by Prowect
 * Author: <NAME>
 * Date: 02.04.2016 - 10:58.
 * Copyright Prowect.
 */

namespace Drips\MVC;

use Smarty;

/**
 * Class View.
 *
 * Stellt die View-Komponente des MVC-Systems dar. Basiert auf der Template-Engine
 * Smarty und implementiert somit alle zugehörigen Funktionen.
 * Für weitere Details siehe: http://www.smarty.net/docs/en/
 */
class View extends Smarty
{
    protected $tmp_dir = '.views';

    public function __construct(){
        parent::__construct();

        // configure smarty
        if(defined('DRIPS_TMP')){
            $this->tmp_dir = DRIPS_TMP.'/'.$this->tmp_dir;
        }
        if(defined('DRIPS_SRC')){
            $this->setTemplateDir(DRIPS_SRC.'/views/');
        } else {
            $this->setTemplateDir($this->tmp_dir.'/templates/');
        }
        $this->setCompileDir($this->tmp_dir.'/templates_c/');
        $this->setConfigDir($this->tmp_dir.'/configs/');
        $this->setCacheDir($this->tmp_dir.'/cache/');

        // Widget-Plugin registrieren
        $this->registerPlugin('function', 'widget', [$this, 'widgetPlugin']);
    }

    public function widgetPlugin($params, $view)
    {
        extract($params);
        if(isset($name)){
            if(class_exists($name)){
                $widget = new $name;
                if($widget instanceof IWidget){
                    return $widget->exec($params, $view);
                }
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.15601835510060008, 'fraction_numerical': 0.008471584892340275, 'mean_word_length': 2.2095130237825593, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1143192', 'n_tokens_mistral': 912, 'n_tokens_neox': 885, 'n_words': 166}