ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractMachine.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
30abstract class AbstractMachine implements FlavourMachine
31{
32 protected ?Engine $engine = null;
33
34 public function __construct()
35 {
36 }
37
39 {
40 $clone = clone $this;
41 $clone->engine = $engine;
42 return $clone;
43 }
44
45 public function getEngine(): Engine
46 {
47 if ($this->engine === null) {
48 throw new \OutOfBoundsException("Engine not available");
49 }
50 return $this->engine;
51 }
52}
withEngine(Engine $engine)
The demanded Engine will be passed here.
__construct()
FlavourMachines must be able to be created without further dependencies.