Reader::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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
}