forked from oroinc/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobalOptionsProviderRegistry.php
42 lines (36 loc) · 1.1 KB
/
GlobalOptionsProviderRegistry.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
<?php
namespace Oro\Bundle\PlatformBundle\Provider\Console;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
class GlobalOptionsProviderRegistry implements GlobalOptionsProviderInterface
{
/**
* @var array|GlobalOptionsProviderInterface[]
*/
private $globalOptionsProviders = [];
/**
* @param GlobalOptionsProviderInterface $globalOptionsProvider
*/
public function registerProvider(GlobalOptionsProviderInterface $globalOptionsProvider)
{
$this->globalOptionsProviders[] = $globalOptionsProvider;
}
/**
* {@inheritdoc}
*/
public function addGlobalOptions(Command $command)
{
foreach ($this->globalOptionsProviders as $globalOptionsProvider) {
$globalOptionsProvider->addGlobalOptions($command);
}
}
/**
* {@inheritdoc}
*/
public function resolveGlobalOptions(InputInterface $input)
{
foreach ($this->globalOptionsProviders as $globalOptionsProvider) {
$globalOptionsProvider->resolveGlobalOptions($input);
}
}
}