Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active February 19, 2024 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/b599977d400cf92eda495f5f5011fb97 to your computer and use it in GitHub Desktop.
Save mcsee/b599977d400cf92eda495f5f5011fb97 to your computer and use it in GitHub Desktop.
<?
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