From bd3aac500158b7842710c43e610f98f85c6e9968 Mon Sep 17 00:00:00 2001 From: Kamil Wylegala Date: Mon, 20 Dec 2021 23:18:50 +0100 Subject: [PATCH] Fixed deprecation notice in PHP 8.1: IteratorAggregate --- lib/Cake/Model/ModelValidator.php | 2 +- lib/Cake/Model/Validator/CakeValidationSet.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); }