1 | <?php |
||
9 | class Execute implements ExecuteInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var ToolInterface[] |
||
13 | */ |
||
14 | private $tools; |
||
15 | |||
16 | /** |
||
17 | * Execute constructor. |
||
18 | * |
||
19 | * @param ToolInterface[] $tools |
||
20 | * |
||
21 | * @throws InvalidToolInterfaceException |
||
22 | */ |
||
23 | 6 | public function __construct(array $tools) |
|
24 | { |
||
25 | 6 | foreach ($tools as $tool) { |
|
26 | 6 | if (!$tool instanceof ToolInterface) { |
|
27 | throw new InvalidToolInterfaceException($tool); |
||
28 | } |
||
29 | } |
||
30 | 6 | $this->tools = $tools; |
|
31 | 6 | } |
|
32 | |||
33 | /** |
||
34 | * @return ToolInterface[] |
||
35 | */ |
||
36 | 4 | public function execute() |
|
40 | |||
41 | /** |
||
42 | * @return Execute |
||
43 | */ |
||
44 | 1 | public function disableTools() |
|
54 | } |
||
55 |