Changeset View
Changeset View
Standalone View
Standalone View
src/object/Phobject.php
| Show All 13 Lines | |||||
| * error (for example, iterating over the wrong variable). Instead of | * error (for example, iterating over the wrong variable). Instead of | ||||
| * permitting the iteration, subclasses will throw when an object is iterated. | * permitting the iteration, subclasses will throw when an object is iterated. | ||||
| * | * | ||||
| * (Legitimately iterable subclasses can provide a working implementation of | * (Legitimately iterable subclasses can provide a working implementation of | ||||
| * Iterator instead.) | * Iterator instead.) | ||||
| */ | */ | ||||
| abstract class Phobject implements Iterator { | abstract class Phobject implements Iterator { | ||||
| public function __get($name) { | |||||
| throw new DomainException( | |||||
| pht( | |||||
| 'Attempt to read from undeclared property %s.', | |||||
| get_class($this).'::'.$name)); | |||||
| } | |||||
| public function __set($name, $value) { | public function __set($name, $value) { | ||||
| throw new DomainException( | throw new DomainException( | ||||
| pht( | pht( | ||||
| 'Attempt to write to undeclared property %s.', | 'Attempt to write to undeclared property %s.', | ||||
| get_class($this).'::'.$name)); | get_class($this).'::'.$name)); | ||||
| } | } | ||||
| public function current() { | public function current() { | ||||
| Show All 27 Lines | |||||