forked from composer-unused/composer-unused
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FilterDependencyCollectionCommand.php
44 lines (35 loc) · 1.11 KB
/
FilterDependencyCollectionCommand.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
<?php
declare(strict_types=1);
namespace Icanhazstring\Composer\Unused\Command;
use Icanhazstring\Composer\Unused\Dependency\DependencyCollection;
use function array_merge;
final class FilterDependencyCollectionCommand
{
private const GLOBAL_EXCLUSION = [
'composer-plugin-api',
];
/** @var DependencyCollection */
private $requiredDependencyCollection;
/** @var array<string> */
private $namedExclusion;
/**
* @param DependencyCollection $requiredDependencyCollection
* @param array<string> $namedExclusion
*/
public function __construct(DependencyCollection $requiredDependencyCollection, array $namedExclusion)
{
$this->requiredDependencyCollection = $requiredDependencyCollection;
$this->namedExclusion = array_merge(self::GLOBAL_EXCLUSION, $namedExclusion);
}
public function getRequiredDependencyCollection(): DependencyCollection
{
return $this->requiredDependencyCollection;
}
/**
* @return array<string>
*/
public function getNamedExclusion(): array
{
return $this->namedExclusion;
}
}