|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* @see https://github.com/soluble-io/soluble-mediatools-cli for the canonical repository |
|
7
|
|
|
* @copyright Copyright (c) 2018-2019 Sébastien Vanvelthem. (https://github.com/belgattitude) |
|
8
|
|
|
* @license https://github.com/soluble-io/soluble-mediatools-cli/blob/master/LICENSE.md MIT |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Soluble\MediaTools\Cli\Config; |
|
12
|
|
|
|
|
13
|
|
|
use Soluble\MediaTools\Cli\Command\ConvertCommand; |
|
14
|
|
|
use Soluble\MediaTools\Cli\Command\ConvertCommandFactory; |
|
15
|
|
|
use Soluble\MediaTools\Cli\Command\ScanCommand; |
|
16
|
|
|
use Soluble\MediaTools\Cli\Command\ScanCommandFactory; |
|
17
|
|
|
use Soluble\MediaTools\Video\Config\ConfigProvider as VideoConfigProvider; |
|
18
|
|
|
|
|
19
|
|
|
class ConfigProvider |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* Returns the configuration array. |
|
23
|
|
|
* |
|
24
|
|
|
* To add a bit of a structure, each section is defined in a separate |
|
25
|
|
|
* method which returns an array with its configuration. |
|
26
|
|
|
*/ |
|
27
|
1 |
|
public function __invoke(): array |
|
28
|
|
|
{ |
|
29
|
|
|
return [ |
|
30
|
1 |
|
'dependencies' => $this->getDependencies(), |
|
31
|
|
|
]; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* Returns the container dependencies. |
|
36
|
|
|
* |
|
37
|
|
|
* @return array<string, array> |
|
38
|
|
|
*/ |
|
39
|
3 |
|
public function getDependencies(): array |
|
40
|
|
|
{ |
|
41
|
3 |
|
return array_merge_recursive( |
|
42
|
3 |
|
(new VideoConfigProvider())->getDependencies(), |
|
43
|
|
|
[ |
|
44
|
3 |
|
'factories' => [ |
|
45
|
|
|
ConvertCommand::class => ConvertCommandFactory::class, |
|
46
|
|
|
ScanCommand::class => ScanCommandFactory::class, |
|
47
|
|
|
], |
|
48
|
|
|
] |
|
49
|
|
|
); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Return build console commands class names. |
|
54
|
|
|
* |
|
55
|
|
|
* @return string[] |
|
56
|
|
|
*/ |
|
57
|
|
|
public function getConsoleCommands(): array |
|
58
|
|
|
{ |
|
59
|
|
|
return [ |
|
60
|
|
|
\Soluble\MediaTools\Cli\Command\ScanCommand::class, |
|
61
|
|
|
\Soluble\MediaTools\Cli\Command\ConvertCommand::class, |
|
62
|
|
|
]; |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|