Skip to content
Snippets Groups Projects
Commit f9cfb3cc authored by Ralf Zimmermann's avatar Ralf Zimmermann Committed by Christian Kuhn
Browse files

[FEATURE] EXT:form - make FinisherVariableProvider iterable

Makes it possible to iterate through FinisherVariableProvider items.

Resolves: #83396
Releases: master
Change-Id: I0b778b9a6d4ede4d2df8190d6b4821903caee6a4
Reviewed-on: https://review.typo3.org/55308


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarJoerg Boesche <typo3@joergboesche.de>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 12c9ab08
Branches
Tags
No related merge requests found
...@@ -24,7 +24,7 @@ use TYPO3\CMS\Core\Utility\ArrayUtility; ...@@ -24,7 +24,7 @@ use TYPO3\CMS\Core\Utility\ArrayUtility;
* **This class is NOT meant to be sub classed by developers.** * **This class is NOT meant to be sub classed by developers.**
* @internal * @internal
*/ */
final class FinisherVariableProvider implements \ArrayAccess final class FinisherVariableProvider implements \ArrayAccess, \IteratorAggregate, \Countable
{ {
/** /**
...@@ -178,4 +178,25 @@ final class FinisherVariableProvider implements \ArrayAccess ...@@ -178,4 +178,25 @@ final class FinisherVariableProvider implements \ArrayAccess
{ {
unset($this->objects[$offset]); unset($this->objects[$offset]);
} }
/**
* @return \Traversable
*/
public function getIterator(): \Traversable
{
foreach ($this->objects as $offset => $value) {
yield $offset => $value;
}
}
/**
* Count elements of an object
*
* @link http://php.net/manual/en/countable.count.php
* @return int The custom count as an integer.
*/
public function count()
{
return count($this->objects);
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment