<commit_before><?php

namespace SQRT;

use SQRT\Tag;
use League\Plates\Engine;
use SQRT\Helpers\Container;

class Layout extends Container
{
  /** @var Engine */
  protected $engine;
  protected $template;

  protected $default_keywords;
  protected $default_description;
  protected $title_tmpl = '%s';

  /** Список подключаемых JS */
  protected $js;
  /** Список подключаемых CSS */
  protected $css;

  function __construct(Engine $engine, $template = null)
  {
    $this->engine   = $engine;
    $this->template = $template;

    $this->init();
  }

  /** Рендеринг страницы */
  public function render($template = null)
  {
    return $this->getEngine()->render($template ?: $this->getTemplate(), array('page' => $this));
  }

  /**
   * Заголовок на странице
   * @return Tag
   */
  public function header($tag = 'h1', $attr = null)
  {
    return new Tag($tag, $this->getHeader() ?: $this->getTitle(), $attr);
  }
<commit_msg>Layout::__toString()<commit_after><?php

namespace SQRT;

use SQRT\Tag;
use League\Plates\Engine;
use SQRT\Helpers\Container;

class Layout extends Container
{
  /** @var Engine */
  protected $engine;
  protected $template;

  protected $default_keywords;
  protected $default_description;
  protected $title_tmpl = '%s';

  /** Список подключаемых JS */
  protected $js;
  /** Список подключаемых CSS */
  protected $css;

  function __construct(Engine $engine, $template = null)
  {
    $this->engine   = $engine;
    $this->template = $template;

    $this->init();
  }

  function __toString()
  {
    return $this->render();
  }

  /** Рендеринг страницы */
  public function render($template = null)
  {
    return $this->getEngine()->render($template ?: $this->getTemplate(), array('page' => $this));
  }

  /**
   * Заголовок на странице
   * @return Tag
   */
  public function header($tag = 'h1', $attr = null)
  {
    return new Tag($tag, $this->getHeader() ?: $this->getTitle(), $attr);
  }

{'fraction_non_alphanumeric': 0.1618556701030928, 'fraction_numerical': 0.0010309278350515464, 'mean_word_length': 3.462068965517241, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '5481866', 'n_tokens_mistral': 674, 'n_tokens_neox': 674, 'n_words': 152}