MediaAssetsFinder::assetsFilter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
namespace AssetsFinder\src\Services;
4
5
class MediaAssetsFinder {
6
7
    /**
8
     * @param string $content
9
     * 
10
     * @return string
11
     */
12
    public static function assetsFilter($content, $ext) {                
13
        $Pattern = '/((https?:\/\/)?(\w+?\.)+?(\w+?\/)+\w+?.('.$ext.'))/im';
14
        preg_match_all($Pattern, $content, $Matches);
15
        
16
        return $Matches[0];
17
    }
18
}
19