| 1 | <?php |
||
| 12 | class ResultList implements \IteratorAggregate |
||
| 13 | { |
||
| 14 | /** @var Vector $results */ |
||
| 15 | private $results; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Initializes the result Vector |
||
| 19 | * |
||
| 20 | * @param int|null $capacity If informed, the vector is initialized with this capacity |
||
| 21 | */ |
||
| 22 | 3 | public function __construct(int $capacity = null) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Adds a result to the list |
||
| 33 | * |
||
| 34 | * @param Result $result |
||
| 35 | */ |
||
| 36 | 2 | public function addResult(Result $result) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Gets all the results. |
||
| 43 | * This method returns a unmodifiable copy of the original collection |
||
| 44 | * |
||
| 45 | * @return Vector |
||
| 46 | */ |
||
| 47 | 2 | public function getResults(): Vector |
|
| 53 | |||
| 54 | /** {@inheritdoc} */ |
||
| 55 | 1 | public function getIterator(): \Iterator |
|
| 59 | } |
||
| 60 |