mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Add explicit return types to `ipl-orm`-derived methods to prepare for strict
typing. These additions are safe, as they only annotate existing methods that
previously lacked return type declarations.
(cherry picked from commit f8d4f92566)
24 lines
527 B
PHP
24 lines
527 B
PHP
<?php
|
|
|
|
namespace Icinga\Module\Icingadb\Model\UnreachableParent;
|
|
|
|
use Generator;
|
|
use Icinga\Module\Icingadb\Redis\VolatileStateResults;
|
|
use Traversable;
|
|
|
|
class ResultSet extends VolatileStateResults
|
|
{
|
|
protected function yieldTraversable(Traversable $traversable): Generator
|
|
{
|
|
$knownIds = [];
|
|
foreach ($traversable as $value) {
|
|
if (isset($knownIds[$value->id])) {
|
|
continue;
|
|
}
|
|
|
|
$knownIds[$value->id] = true;
|
|
|
|
yield $value;
|
|
}
|
|
}
|
|
}
|