mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-06 15:06:31 +02:00
26 lines
446 B
PHP
26 lines
446 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Structural\Facade;
|
|
|
|
class Facade
|
|
{
|
|
public function __construct(private Bios $bios, private OperatingSystem $os)
|
|
{
|
|
}
|
|
|
|
public function turnOn()
|
|
{
|
|
$this->bios->execute();
|
|
$this->bios->waitForKeyPress();
|
|
$this->bios->launch($this->os);
|
|
}
|
|
|
|
public function turnOff()
|
|
{
|
|
$this->os->halt();
|
|
$this->bios->powerDown();
|
|
}
|
|
}
|