. namespace hoplite\base; /*! Objects that expose public properties without accessors |public $foo = NULL;| should inherit from this class to prevent undefined property access. This prevents subtle bugs caused by typos. For arbitrary key-value storage, use a Dictionary. */ class StrictObject { public function __get($key) { throw new StrictObjectException('Cannot get ' . get_class($this) . '::' . $key); } public function __set($key, $value) { throw new StrictObjectException('Cannot set ' . get_class($this) . '::' . $key); } } class StrictObjectException extends \Exception {}