Completed
Push — master ( 66817c...5dccbe )
by Peter
02:23
created

ParserMeta   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMeta() 0 8 3
1
<?php
2
/**
3
 * @author Peter Gribanov <[email protected]>
4
 */
5
6
namespace GpsLab\Component\ImageMeta;
7
8
class ParserMeta
9
{
10
    /**
11
     * @param string $filename
12
     *
13
     * @return DataMeta|null
14
     */
15 3
    public function getMeta($filename)
16
    {
17 3
        if (file_exists($filename) && ($info = @getimagesize($filename))) {
18 1
            return new DataMeta($info[0], $info[1], $info['mime']);
19
        } else {
20 2
            return null;
21
        }
22
    }
23
}
24