| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | protected function detect(string $subject) : array |
||
| 40 | { |
||
| 41 | $matches = array(); |
||
| 42 | preg_match_all(self::REGEX, $subject, $matches, PREG_PATTERN_ORDER); |
||
| 43 | |||
| 44 | $result = array(); |
||
| 45 | $matches = array_unique($matches[2]); |
||
| 46 | foreach($matches as $match) { |
||
| 47 | $match = trim($match); |
||
| 48 | if(!empty($match) && !in_array($match, $result)) { |
||
| 49 | $result[] = $match; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | return $result; |
||
| 54 | } |
||
| 56 |