Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 3 | public function buildMediaInfoCommandRunner($filepath, array $configuration = array()) |
|
17 | { |
||
18 | 3 | $fileSystem = new Filesystem(); |
|
19 | |||
20 | 3 | if (!$fileSystem->exists($filepath)) { |
|
21 | 1 | throw new \Exception('File doesn\'t exist'); |
|
22 | } |
||
23 | |||
24 | 2 | if (is_dir($filepath)) { |
|
25 | throw new \Exception('You must specify a filename, not a directory name'); |
||
26 | } |
||
27 | |||
28 | $configuration = $configuration + array( |
||
29 | 2 | 'command' => null, |
|
30 | 2 | ); |
|
31 | |||
32 | 2 | return new MediaInfoCommandRunner($filepath, $configuration['command']); |
|
33 | } |
||
34 | } |
||
35 |