ImageMetaAnalyzer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A analyze() 0 8 3
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Component\ImageMeta;
11
12
class ImageMetaAnalyzer
13
{
14
    /**
15
     * @param string $filename
16
     *
17
     * @return ImageMetadata|null
18
     */
19 7
    public function analyze($filename)
20
    {
21 7
        if (file_exists($filename) && ($info = @getimagesize($filename))) {
22 5
            return new ImageMetadata($info[0], $info[1], $info['mime']);
23
        } else {
24 2
            return null;
25
        }
26
    }
27
}
28