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