LinkHighLighter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A replaceWebLinks() 0 7 2
1
<?php
2
3
namespace LinkEmailHighLighter\src\Services;
4
5
class LinkHighLighter {
6
7
    /**
8
     * 
9
     * @param string $content
10
     * @return string
11
     */
12
    public static function replaceWebLinks($content) {
13
14
        if (!empty($content)) {
15
            $processedString = preg_replace('/(^|[^"])(((f|ht){1}(tp|tps):\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i', '\\1<a href="\\2" target="_blank">\\2</a>', $content);
16
            return $processedString;
17
        }
18
    }
19
20
}
21