mirror of
https://github.com/danog/amp.git
synced 2024-12-15 19:07:22 +01:00
22 lines
506 B
PHP
22 lines
506 B
PHP
|
<?php
|
||
|
|
||
|
namespace Amp;
|
||
|
|
||
|
class Struct {
|
||
|
final public function __get($property) {
|
||
|
throw new \DomainException(
|
||
|
$this->generatePropertyError($property)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
final public function __set($property, $value) {
|
||
|
throw new \DomainException(
|
||
|
$this->generatePropertyError($property)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
private function generatePropertyError($property) {
|
||
|
return sprintf("Struct property %s::%s does not exist", get_class($this), $property);
|
||
|
}
|
||
|
}
|