Merge pull request #5 from kamilwylegala/2-iterator-aggregate

Fixed deprecation notice in PHP 8.1: IteratorAggregate
This commit is contained in:
Kamil Wylegala 2021-12-20 23:21:46 +01:00 committed by GitHub
commit bfe52deb9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

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

View file

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