-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArrayConfig.php
57 lines (47 loc) · 1.38 KB
/
ArrayConfig.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* @see https://github.com/open-code-modeling/php-code-generator for the canonical source repository
* @copyright https://github.com/open-code-modeling/php-code-generator/blob/master/COPYRIGHT.md
* @license https://github.com/open-code-modeling/php-code-generator/blob/master/LICENSE.md MIT License
*/
declare(strict_types=1);
namespace OpenCodeModeling\CodeGenerator\Config;
use OpenCodeModeling\CodeGenerator\Workflow\Description;
use Symfony\Component\Console\Command\Command;
/**
* @deprecated Use \OpenCodeModeling\CodeGenerator\Config\Workflow
*/
final class ArrayConfig implements Component
{
/**
* @var Description[]
**/
private $config;
/**
* @var Command[]
**/
private $consoleCommands = [];
public function __construct(Description ...$config)
{
$this->config = $config;
}
public function componentDescriptions(): array
{
return $this->config;
}
public function consoleCommands(): iterable
{
return $this->consoleCommands;
}
/**
* Add console commands which are added to the code generator CLI
*
* @param Command ...$consoleCommands
*/
public function addConsoleCommands(Command ...$consoleCommands): void
{
foreach ($consoleCommands as $consoleCommand) {
$this->consoleCommands[] = $consoleCommand;
}
}
}