<commit_before><?php
namespace rock\template;

use rock\base\Alias;
use rock\cache\CacheInterface;
use rock\events\Event;
use rock\events\EventsInterface;
use rock\events\EventsTrait;
use rock\helpers\ArrayHelper;
use rock\helpers\FileHelper;
use rock\helpers\Helper;
use rock\helpers\Instance;
use rock\helpers\Json;
use rock\helpers\NumericHelper;
use rock\helpers\Serialize;
use rock\helpers\StringHelper;
use rock\i18n\i18n;
use rock\snippets\Snippet;
use rock\template\filters\ConditionFilter;

class Template implements EventsInterface
{
    use EventsTrait;

    const ESCAPE = 1;
    const STRIP_TAGS = 2;
    const TO_TYPE = 4;
    const ENGINE_ROCK = 1;
    const ENGINE_PHP = 2;

    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::beginPage()}.
     */
    const EVENT_BEGIN_PAGE = 'beginPage';
    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::endPage()}.
     */
    const EVENT_END_PAGE = 'endPage';

    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::beginBody()}.
     */
    const EVENT_BEGIN_BODY = 'beginBody';
    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::endBody()}.
     */
    const EVENT_END_BODY = 'endBody';
    /**
     * The location of registered JavaScript code block or files.
     * This means the location is in the head section.
     */
    const POS_HEAD = 1;
    /**
     * The location of registered JavaScript code block or files.
     * This means the location is at the beginning of the body section.
     */
    const POS_BEGIN = 2;
    /**
     * The location of registered JavaScript code block or files.
     * This means the location is at the end of the body section.
     */
    const POS_END = 3;

    /**
     * Mapping extensions with engines.
     *
     * @var array
     */
    public $engines = [
        self::ENGINE_ROCK => 'html',
        self::ENGINE_PHP => 'php',
    ];
    /**
     * Use of engine default.
     *
     * @var int
     */
    public $defaultEngine = self::ENGINE_ROCK;
    /**
     * List filters.
     *
     * @var array
     */
    public $filters = [];
    /**
     * List snippets.
     *
     * @var array
     */
    public $snippets = [];
    /**
     * Collection extensions.
     *
     * @var array
     */
    public $extensions = [];
    /**
     * Handler for replace link: `[[~context]]`
     * @var callable
     */
    public $handlerLink;
    /**
     * Is mode auto-escaping.
     *
     * @var int|bool
     */<commit_msg>[skip CI] Fixed PHPDoc.<commit_after><?php
namespace rock\template;

use rock\base\Alias;
use rock\cache\CacheInterface;
use rock\events\Event;
use rock\events\EventsInterface;
use rock\events\EventsTrait;
use rock\helpers\ArrayHelper;
use rock\helpers\FileHelper;
use rock\helpers\Helper;
use rock\helpers\Instance;
use rock\helpers\Json;
use rock\helpers\NumericHelper;
use rock\helpers\Serialize;
use rock\helpers\StringHelper;
use rock\i18n\i18n;
use rock\snippets\Snippet;
use rock\template\filters\ConditionFilter;

class Template implements EventsInterface
{
    use EventsTrait;

    const ESCAPE = 1;
    const STRIP_TAGS = 2;
    const TO_TYPE = 4;
    const ENGINE_ROCK = 1;
    const ENGINE_PHP = 2;

    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::beginPage()}.
     */
    const EVENT_BEGIN_PAGE = 'beginPage';
    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::endPage()}.
     */
    const EVENT_END_PAGE = 'endPage';

    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::beginBody()}.
     */
    const EVENT_BEGIN_BODY = 'beginBody';
    /**
     * @event Event an event that is triggered by {@see \rock\template\Template::endBody()}.
     */
    const EVENT_END_BODY = 'endBody';
    /**
     * The location of registered JavaScript code block or files.
     * This means the location is in the head section.
     */
    const POS_HEAD = 1;
    /**
     * The location of registered JavaScript code block or files.
     * This means the location is at the beginning of the body section.
     */
    const POS_BEGIN = 2;
    /**
     * The location of registered JavaScript code block or files.
     * This means the location is at the end of the body section.
     */
    const POS_END = 3;

    /**
     * Mapping extensions with engines.
     *
     * @var array
     */
    public $engines = [
        self::ENGINE_ROCK => 'html',
        self::ENGINE_PHP => 'php',
    ];
    /**
     * Use of engine default.
     *
     * @var int
     */
    public $defaultEngine = self::ENGINE_ROCK;
    /**
     * List filters.
     *
     * @var array
     */
    public $filters = [];
    /**
     * List snippets.
     *
     * @var array
     */
    public $snippets = [];
    /**
     * Collection extensions.
     *
     * @var array
     */
    public $extensions = [];
    /**
     * Handler for replace link: `[[~link]]`
     * @var callable
     */
    public $handlerLink;
    /**
     * Is mode auto-escaping.
     *
     * @var int|bool
     */
{'fraction_non_alphanumeric': 0.11993799651230382, 'fraction_numerical': 0.004650261577213718, 'mean_word_length': 2.2941927249521377, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7627762', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1584, 'n_words': 463}