<commit_before><?php
namespace JayaCode\Framework\Core\View\Template;

/**
 * Class BasicTemplate
 * @package JayaCode\Framework\Core\View\Template
 */
class BasicTemplate extends Template
{
    /**
     * @var
     */
    protected $parent;

    /**
     * @return string
     */
    public function buildScript()
    {
        $fileCache = $this->cacheDir.str_replace(["/", "."], "_", $this->fileTemplate);
        if ($this->cacheDir !== null && file_exists($fileCache) && empty($this->contentParent)) {
            return $this->script = file_get_contents($fileCache);
        }

        $this->script = $this->converter->build(file_get_contents($this->locTemplate));

        if ($this->cacheDir !== null && empty($this->contentParent)) {
            file_put_contents($fileCache, $this->script);
        }
    }

    /**
     * @return mixed|string
     */
    public function render()
    {
        if (!$this->script) {
            $this->buildScript();
        }

        extract($this->vars->all());
        ob_start();
        eval("?>" . $this->script);
        $result = ob_get_contents();
        ob_end_clean();
        
        if ($this->parent) {
            $fileParent = $this->parent.Template::$extension;
            $parent = new BasicTemplate($this->locView, $fileParent, $this->variableCollector, $this->converter);
            $parent->setContentParent($this->contentParent);
            return $parent->render();
        }<commit_msg>type string|null is loosely compared to false<commit_after><?php
namespace JayaCode\Framework\Core\View\Template;

/**
 * Class BasicTemplate
 * @package JayaCode\Framework\Core\View\Template
 */
class BasicTemplate extends Template
{
    /**
     * @var
     */
    protected $parent;

    /**
     * @return string
     */
    public function buildScript()
    {
        $fileCache = $this->cacheDir.str_replace(["/", "."], "_", $this->fileTemplate);
        if ($this->cacheDir !== null && file_exists($fileCache) && empty($this->contentParent)) {
            return $this->script = file_get_contents($fileCache);
        }

        $this->script = $this->converter->build(file_get_contents($this->locTemplate));

        if ($this->cacheDir !== null && empty($this->contentParent)) {
            file_put_contents($fileCache, $this->script);
        }
    }

    /**
     * @return mixed|string
     */
    public function render()
    {
        if ($this->script === null) {
            $this->buildScript();
        }

        $varArray = $this->vars->all();
        extract($varArray);
        
        ob_start();
        eval("?>" . $this->script);
        $result = ob_get_contents();
        ob_end_clean();
        
        if ($this->parent) {
            $fileParent = $this->parent.Template::$extension;
            $parent = new BasicTemplate($this->locView, $fileParent, $this->variableCollector, $this->converter);
            $parent->setContentParent($this->contentParent);
            return $parent->render();
        }
{'fraction_non_alphanumeric': 0.16688874083944039, 'fraction_numerical': 0.0, 'mean_word_length': 2.318232044198895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, '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': '4541765', 'n_tokens_mistral': 857, 'n_tokens_neox': 844, 'n_words': 141}