Fixed deprecation notice in PHP 8.1: IteratorAggregate

This commit is contained in:
Kamil Wylegala 2021-12-20 23:18:50 +01:00
parent e78874b3e3
commit bd3aac5001
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}

View file

@ -354,7 +354,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
*
* @return ArrayIterator
*/
public function getIterator() {
public function getIterator() : Traversable {
return new ArrayIterator($this->_rules);
}