Code Duplication    Length = 4-4 lines in 2 locations

src/TextExtension.php 2 locations

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