<commit_before><?php

namespace Picon\Lib;

class View{

    protected   $layout;
    protected   $view;
    protected   $vars;

    protected   $isRenderedLayout;

    public function __construct($viewInfos, $vars = array()){
        $this->layout           =   $viewInfos["layout"]; 
        $this->view             =   $viewInfos["view"];
        $this->vars             =   $vars;
        $this->isRenderedLayout = false;
    }

    public function setView($viewName){
        $this->view     =  $viewName; 
    }

    public function setLayout($layoutName){
        $this->layout   =   $layoutName;
    }

    public function render($view = ""){
        // Here we render view && layout
        if(!$view && $this->layout && !$this->isRenderedLayout){
            $this->render("_layout/" . $this->layout);
            $this->isRenderedLayout =   true;<commit_msg>[fix] Fix. when call render() with no arg, but a view is already set<commit_after><?php

namespace Picon\Lib;

class View{

    protected   $layout;
    protected   $view;
    protected   $vars;

    protected   $isRenderedLayout;

    public function __construct($viewInfos, $vars = array()){
        $this->layout           =   $viewInfos["layout"]; 
        $this->view             =   $viewInfos["view"];
        $this->vars             =   $vars;
        $this->isRenderedLayout = false;
    }

    public function setView($viewName){
        $this->view     =  $viewName; 
    }

    public function setLayout($layoutName){
        $this->layout   =   $layoutName;
    }

    public function render($view = ""){
        // Here we render view && layout
        !$view && $this->view && $view = $this->view;
        if(!$view && $this->layout && !$this->isRenderedLayout){
            $this->render("_layout/" . $this->layout);
            $this->isRenderedLayout =   true;
{'fraction_non_alphanumeric': 0.14564158094206822, 'fraction_numerical': 0.0, 'mean_word_length': 2.0697674418604652, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '3161122', 'n_tokens_mistral': 554, 'n_tokens_neox': 537, 'n_words': 118}