| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.3332 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 1 | public function __invoke(ContainerInterface $container): FFMpegConfig |
|
| 16 | { |
||
| 17 | 1 | $key = 'ffmpeg.binary'; |
|
| 18 | 1 | $config = $container->get('config')['soluble-mediatools'] ?? []; |
|
| 19 | |||
| 20 | 1 | if (!isset($config[$key]) || trim((string) $config[$key]) === '') { |
|
| 21 | throw new InvalidConfigException( |
||
| 22 | sprintf( |
||
| 23 | 'The [\'%s\'] value is missing in config [\'soluble-mediatools\']', |
||
| 24 | $key |
||
| 25 | ) |
||
| 26 | ); |
||
| 27 | } |
||
| 28 | 1 | $threads = $config['ffmpeg.conversion.threads'] ?? null; |
|
| 29 | 1 | $timeout = $config['ffmpeg.conversion.timeout'] ?? null; |
|
| 30 | 1 | $idleTimeout = $config['ffmpeg.conversion.idle_timeout'] ?? null; |
|
| 31 | |||
| 32 | 1 | return new FFMpegConfig($config[$key], $threads, $timeout, $idleTimeout); |
|
| 33 | } |
||
| 35 |