Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active Jun 8, 2021
Embed
What would you like to do?
<?
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 $batery, 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