| 1 | <?php |
||
| 9 | class Machine extends InstallerTask implements DependentChainProcessInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var UserInteraction |
||
| 13 | */ |
||
| 14 | private $userInteraction; |
||
| 15 | /** |
||
| 16 | * @var \Dock\Docker\Machine\Machine |
||
| 17 | */ |
||
| 18 | private $machine; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param UserInteraction $userInteraction |
||
| 22 | * @param \Dock\Docker\Machine\Machine $machine |
||
| 23 | */ |
||
| 24 | public function __construct(UserInteraction $userInteraction, \Dock\Docker\Machine\Machine $machine) |
||
| 25 | { |
||
| 26 | $this->userInteraction = $userInteraction; |
||
| 27 | $this->machine = $machine; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritdoc} |
||
| 32 | */ |
||
| 33 | public function run() |
||
| 34 | { |
||
| 35 | if (!$this->machine->isCreated()) { |
||
| 36 | $this->machine->create(); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function dependsOn() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function getName() |
||
| 55 | } |
||
| 56 |