Code Duplication    Length = 4-4 lines in 2 locations

src/TextExtension.php 2 locations

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