<commit_before><?php

namespace CoenJacobs\Mozart\Replace;

class ClassmapReplacer extends BaseReplacer
{
    public function replace( $content )
    {
        return $content;
    }
}<commit_msg>Regex magic for classmap replacer<commit_after><?php

namespace CoenJacobs\Mozart\Replace;

class ClassmapReplacer extends BaseReplacer
{
    public function replace( $contents )
    {
        return preg_replace_callback(
            '/(?:\W[abstract]*class |interface )([a-zA-Z\_]+)[ ]*{/U',
            function ($matches) {
                $replace = 'CJDT_' . $matches[1];
                return str_replace($matches[1], $replace, $matches[0]);
            },
            $contents
        );
    }
}
{'fraction_non_alphanumeric': 0.12696148359486448, 'fraction_numerical': 0.0042796005706134095, 'mean_word_length': 2.4925373134328357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1986335', 'n_tokens_mistral': 217, 'n_tokens_neox': 213, 'n_words': 44}