<commit_before><?php

namespace RenatoMarinho\LaravelPageSpeed\Middleware;

class RemoveQuotes extends PageSpeed
{
    public function apply($buffer)
    {
        $replace = [
            '/src="(.*?)"/' => 'src=$1',
            '/width="(.*?)"/' => 'width=$1',
            '/height="(.*?)"/' => 'height=$1',
            '/name="(.*?)"/' => 'name=$1',
            '/charset="(.*?)"/' => 'charset=$1',
            //'/href="(.*?)"/' => 'href=$1',
            '/align="(.*?)"/' => 'align=$1',
            '/border="(.*?)"/' => 'border=$1',
            '/crossorigin="(.*?)"/' => 'crossorigin=$1',
            //'/rel="(.*?)"/' => 'rel=$1',
            '/type="(.*?)"/' => 'type=$1',
            '/\/>/' => '>',
        ];

        return $this->replace($replace, $buffer);
    }
}<commit_msg>Added spaces before patterns and replaces<commit_after><?php

namespace RenatoMarinho\LaravelPageSpeed\Middleware;

class RemoveQuotes extends PageSpeed
{
    public function apply($buffer)
    {
        $replace = [
            '/ src="(.*?)"/' => ' src=$1',
            '/ width="(.*?)"/' => ' width=$1',
            '/ height="(.*?)"/' => ' height=$1',
            '/ name="(.*?)"/' => ' name=$1',
            '/ charset="(.*?)"/' => ' charset=$1',
            //'/ href="(.*?)"/' => ' href=$1',
            '/ align="(.*?)"/' => ' align=$1',
            '/ border="(.*?)"/' => ' border=$1',
            '/ crossorigin="(.*?)"/' => ' crossorigin=$1',
            //'/ rel="(.*?)"/' => ' rel=$1',
            '/ type="(.*?)"/' => ' type=$1',
            '/\/>/' => '>',
        ];

        return $this->replace($replace, $buffer);
    }
}
{'fraction_non_alphanumeric': 0.3125, 'fraction_numerical': 0.013480392156862746, 'mean_word_length': 1.7491582491582491, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '7565952', 'n_tokens_mistral': 543, 'n_tokens_neox': 534, 'n_words': 77}