/** * This is the perfect time to use a dependency injection container * to create an instance of this class * * @param BiosInterface $bios * @param OsInterface $os */ publicfunction__construct(BiosInterface $bios, OsInterface $os) { $this->bios = $bios; $this->os = $os; }
/** * turn on the system */ publicfunctionturnOn() { $this->bios->execute(); $this->bios->waitForKeyPress(); $this->bios->launch($this->os); }
/** * turn off the system */ publicfunctionturnOff() { $this->os->halt(); $this->bios->powerDown(); } }