Metadata   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 10
c 1
b 1
f 0
dl 0
loc 51
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getExif() 0 3 1
A getXMP() 0 3 1
A getIPTC() 0 3 1
1
<?php
2
3
namespace Jackal\ImageMerge\Metadata;
4
5
use Jackal\ImageMerge\Exception\ModuleNotFoundException;
6
use Jackal\ImageMerge\Metadata\Parser\ExifParser;
7
use Jackal\ImageMerge\Metadata\Parser\IPTCParser;
8
use Jackal\ImageMerge\Metadata\Parser\XMPParser;
9
use Jackal\ImageMerge\Model\File\FileObjectInterface;
10
11
/**
12
 * Class Metadata
13
 * @package Jackal\ImageMerge\Metadata
14
 */
15
class Metadata
16
{
17
    /**
18
     * @var ExifParser
19
     */
20
    private $exif;
21
22
    /**
23
     * @var XMPParser
24
     */
25
    private $xmp;
26
27
    /**
28
     * @var IPTCParser
29
     */
30
    private $iptc;
31
32
    /**
33
     * Metadata constructor.
34
     * @param FileObjectInterface $file
35
     * @throws ModuleNotFoundException
36
     */
37
    public function __construct(FileObjectInterface $file)
38
    {
39
        $this->exif = new ExifParser($file);
40
        $this->xmp = new XMPParser($file);
41
        $this->iptc = new IPTCParser($file);
42
    }
43
44
    /**
45
     * @return ExifParser
46
     */
47
    public function getExif()
48
    {
49
        return $this->exif;
50
    }
51
52
    /**
53
     * @return XMPParser
54
     */
55
    public function getXMP()
56
    {
57
        return $this->xmp;
58
    }
59
60
    /**
61
     * @return IPTCParser
62
     */
63
    public function getIPTC()
64
    {
65
        return $this->iptc;
66
    }
67
}
68