ImageUtility   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSize() 0 14 1
1
<?php
2
3
namespace ImageSizeFinder\src\Services;
4
5
class ImageUtility {
6
7
    /**
8
     * 
9
     * @param string $image
10
     * 
11
     * @return string
12
     */
13
    public static function getSize($image)
14
    {   
15
        $ch = curl_init();
16
        curl_setopt($ch, CURLOPT_URL, $image);
17
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
18
        curl_setopt($ch, CURLOPT_HEADER, TRUE);
19
        curl_setopt($ch, CURLOPT_NOBODY, TRUE);
20
21
        curl_exec($ch);
22
        $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
23
        curl_close($ch);
24
        
25
        return $size;
26
    }
27
}
28