<commit_before><?php
/**
 *
 * CSS rule API.
 *
 */
namespace CssCrush;

class Rule implements \IteratorAggregate
{
    public $vendorContext;
    public $label;
    public $marker;
    public $name;
    public $isAbstract;
    public $isFlat = true;

    public $selectors;
    public $declarations;

    // Arugments passed via @extend.
    public $extendArgs = array();
    public $extendSelectors = array();

    // Declarations hash table for inter-rule this() referencing.
    public $selfData = array();

    // Declarations hash table for external query() referencing.
    public $queryData = array();

    public function __construct($selector_string, $declarations_string, $trace_token = null)
    {
        $process = CssCrush::$process;
        $this->label = $process->tokens->createLabel('r');
        $this->marker = $process->addTracingStubs || $process->generateMap ? $trace_token : null;
        $this->selectors = new SelectorList();
        $this->declarations = new DeclarationList();

        if (! empty(Hook::$register['rule_preprocess'])) {
            // Juggling to maintain the old API.
            $rule = new \stdClass();
            $rule->selector_raw = $selector_string;
            $rule->declaration_raw = $declarations_string;
            Hook::run('rule_preprocess', $rule);
            $selector_string = $rule->selector_raw;
            $declarations_string = $rule->declaration_raw;
        }

        // Parse selectors.
        // Strip any other comments then create selector instances.
        $selector_string = trim(Util::stripCommentTokens($selector_string));

        foreach (Util::splitDelimList($selector_string) as $selector) {

            if (preg_match(Regex::$patt->abstract, $selector, $m)) {
                $this->name = strtolower($m['name']);<commit_msg>Removing legacy rule_preprocess hook code.<commit_after><?php
/**
 *
 * CSS rule API.
 *
 */
namespace CssCrush;

class Rule implements \IteratorAggregate
{
    public $vendorContext;
    public $label;
    public $marker;
    public $name;
    public $isAbstract;
    public $isFlat = true;

    public $selectors;
    public $declarations;

    // Arugments passed via @extend.
    public $extendArgs = array();
    public $extendSelectors = array();

    // Declarations hash table for inter-rule this() referencing.
    public $selfData = array();

    // Declarations hash table for external query() referencing.
    public $queryData = array();

    public function __construct($selector_string, $declarations_string, $trace_token = null)
    {
        $process = CssCrush::$process;
        $this->label = $process->tokens->createLabel('r');
        $this->marker = $process->addTracingStubs || $process->generateMap ? $trace_token : null;
        $this->selectors = new SelectorList();
        $this->declarations = new DeclarationList();

        // Parse selectors.
        // Strip any other comments then create selector instances.
        $selector_string = trim(Util::stripCommentTokens($selector_string));

        foreach (Util::splitDelimList($selector_string) as $selector) {

            if (preg_match(Regex::$patt->abstract, $selector, $m)) {
                $this->name = strtolower($m['name']);
{'fraction_non_alphanumeric': 0.12840346534653466, 'fraction_numerical': 0.0, 'mean_word_length': 2.918787878787879, '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': '2058882', 'n_tokens_mistral': 920, 'n_tokens_neox': 903, 'n_words': 224}