From 5f2ddf506de7e11fd136bba09fca5e7c10f79faf Mon Sep 17 00:00:00 2001 From: TeaMohn Date: Mon, 16 Feb 2026 10:17:37 +0100 Subject: [PATCH] fix: add compatible return type to Contacts::getIterator() Adds Traversable return type to satisfy IteratorAggregate interface contract and suppress PHP deprecation notice for incompatible return type declaration. --- src/contacts/Contacts.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/contacts/Contacts.php b/src/contacts/Contacts.php index 16c77fa..e245e7d 100644 --- a/src/contacts/Contacts.php +++ b/src/contacts/Contacts.php @@ -3,6 +3,7 @@ namespace de\xqueue\maileon\api\client\contacts; use ArrayIterator; +use Traversable; use de\xqueue\maileon\api\client\xml\AbstractXMLWrapper; use IteratorAggregate; use SimpleXMLElement; @@ -39,9 +40,9 @@ public function addContact($contact) } /** - * @return ArrayIterator an iterator for the contacts in this list of contacts + * @return Traversable an iterator for the contacts in this list of contacts */ - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->contacts); }