Reader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A read() 0 7 1
1
<?php
2
3
namespace ExiftoolReader;
4
5
use Symfony\Component\Process\Process;
6
7
/**
8
 * Class Reader
9
 */
10
class Reader
11
{
12
    /**
13
     * @var Command
14
     */
15
    private $command;
16
17
    /**
18
     * Reader constructor.
19
     *
20
     * @param Command $command
21
     */
22
    public function __construct(Command $command)
23
    {
24
        $this->command = $command;
25
    }
26
27
    /**
28
     * @param string $filename
29
     * @return Result
30
     */
31
    public function read($filename)
32
    {
33
        $process = new Process($this->command->build($filename));
34
        $process->run();
35
36
        return new Result($process->getOutput());
37
    }
38
}