diff --git a/lib/Cake/Model/ModelValidator.php b/lib/Cake/Model/ModelValidator.php index 7c34d94e4..6f2c02d2b 100644 --- a/lib/Cake/Model/ModelValidator.php +++ b/lib/Cake/Model/ModelValidator.php @@ -513,7 +513,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable { * * @return ArrayIterator */ - public function getIterator() { + public function getIterator() : Traversable { $this->_parseRules(); return new ArrayIterator($this->_fields); } diff --git a/lib/Cake/Model/Validator/CakeValidationSet.php b/lib/Cake/Model/Validator/CakeValidationSet.php index e04453e05..68ff212e7 100644 --- a/lib/Cake/Model/Validator/CakeValidationSet.php +++ b/lib/Cake/Model/Validator/CakeValidationSet.php @@ -354,7 +354,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable { * * @return ArrayIterator */ - public function getIterator() { + public function getIterator() : Traversable { return new ArrayIterator($this->_rules); }