Code Duplication    Length = 4-4 lines in 2 locations

src/TextExtension.php 2 locations

@@ 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
    /**
@@ 143-146 (lines=4) @@
140
    {
141
        $regexp = '~([^\s<>]+?@[^\s<>]+?\.[^\s<>]+)(?<![\.,:;\?!\'"\|])~';
142
143
        return preg_replace_callback($regexp, function ($match) use (&$links, $attr) {
144
            return '<' . array_push($links, '<a' . $attr . ' href="mailto:' . $match[1] . '">' . $match[1] . '</a>')
145
                . '>';
146
        }, $text);
147
    }
148
149