Code Duplication    Length = 4-4 lines in 2 locations

src/TextExtension.php 2 locations

@@ 144-147 (lines=4) @@
141
    {
142
        $regexp = '~([^\s<>]+?@[^\s<>]+?\.[^\s<>]+)(?<![\.,:;\?!\'"\|])~';
143
        
144
        return preg_replace_callback($regexp, function ($match) use (&$links, $attr) {
145
            return '<' . array_push($links, '<a' . $attr . ' href="mailto:' . $match[1] . '">' . $match[1] . '</a>')
146
                . '>';
147
        }, $text);
148
    }
149
    
150
    
@@ 170-173 (lines=4) @@
167
            ? '~' . preg_quote($protocol, '~') . '([^\s<>]+)(?<![\.,:;\?!\'"\|])~i'
168
            : '~([^\s<>]+)(?<![\.,:])~i';
169
        
170
        return preg_replace_callback($regexp, function ($match) use ($protocol, &$links, $attr) {
171
            return '<' . array_push($links, '<a' . $attr . ' href="' . $protocol . $match[1] . '">' . $match[1]
172
                . '</a>') . '>';
173
        }, $text);
174
    }
175
    
176
    /**