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.
27 lines
638 B
PHP
27 lines
638 B
PHP
<?php
|
|
|
|
// SPDX-FileCopyrightText: 2025 Icinga GmbH <https://icinga.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|