Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 57.89% |
Changes | 0 |
1 | <?php |
||
10 | trait ConfigTrait |
||
11 | { |
||
12 | 1 | protected function getFFMpegConfig(ContainerInterface $container): FFMpegConfig |
|
13 | { |
||
14 | 1 | $key = 'ffmpeg.binary'; |
|
15 | 1 | $config = $container->get('config')['soluble-mediatools'] ?? []; |
|
16 | |||
17 | 1 | if (!isset($config[$key]) || trim($config[$key]) === '') { |
|
18 | throw new InvalidConfigException( |
||
19 | sprintf( |
||
20 | 'The [\'%s\'] value is missing in config [\'soluble-mediatools\']', |
||
21 | $key |
||
22 | ) |
||
23 | ); |
||
24 | } |
||
25 | 1 | $threads = $config['ffmpeg.threads'] ?? null; |
|
26 | |||
27 | 1 | return new FFMpegConfig($config[$key], $threads); |
|
28 | } |
||
29 | |||
30 | 1 | protected function getFFProbeConfig(ContainerInterface $container): FFProbeConfig |
|
44 | } |
||
45 | } |
||
46 |