Changeset View
Changeset View
Standalone View
Standalone View
src/object/Phobject.php
Show All 27 Lines | abstract class Phobject implements Iterator { | ||||
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)); | ||||
} | } | ||||
#[\ReturnTypeWillChange] | |||||
public function current() { | public function current() { | ||||
$this->throwOnAttemptedIteration(); | $this->throwOnAttemptedIteration(); | ||||
} | } | ||||
#[\ReturnTypeWillChange] | |||||
public function key() { | public function key() { | ||||
$this->throwOnAttemptedIteration(); | $this->throwOnAttemptedIteration(); | ||||
} | } | ||||
#[\ReturnTypeWillChange] | |||||
public function next() { | public function next() { | ||||
$this->throwOnAttemptedIteration(); | $this->throwOnAttemptedIteration(); | ||||
} | } | ||||
#[\ReturnTypeWillChange] | |||||
public function rewind() { | public function rewind() { | ||||
$this->throwOnAttemptedIteration(); | $this->throwOnAttemptedIteration(); | ||||
} | } | ||||
#[\ReturnTypeWillChange] | |||||
public function valid() { | public function valid() { | ||||
$this->throwOnAttemptedIteration(); | $this->throwOnAttemptedIteration(); | ||||
} | } | ||||
private function throwOnAttemptedIteration() { | private function throwOnAttemptedIteration() { | ||||
throw new DomainException( | throw new DomainException( | ||||
pht( | pht( | ||||
'Attempting to iterate an object (of class %s) which is not iterable.', | 'Attempting to iterate an object (of class %s) which is not iterable.', | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0