Last active
February 19, 2024 15:27
-
-
Save mcsee/b599977d400cf92eda495f5f5011fb97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
abstract class ElectronicDevice { | |
protected $battery; | |
public function __construct(OperatingSystem $battery) { | |
$this->battery = $battery; | |
} | |
} | |
abstract class Idevice extends ElectronicDevice { | |
protected $operatingSystem; | |
public function __construct(Battery $battery, OperatingSystem $ios) { | |
$this->operatingSystem = $ios; | |
parent::__construct($battery) | |
} | |
} | |
final class Ipad extends Idevice { | |
public function __construct(Battery $battery, OperatingSystem $ios) { | |
parent::__construct($battery, $ios) | |
} | |
} | |
final class Iphone extends Idevice { | |
private $phoneModule; | |
public __construct(Battery $battery, | |
OperatingSystem $ios, | |
PhoneModule $phoneModule) { | |
$this->phoneModule = $phoneModule; | |
parent::__construct($battery, $ios) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment