Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
providercollection.php
1<?php
2
4
5class ProviderCollection implements \IteratorAggregate, \Countable
6{
8 private array $providers;
9
10 public function __construct(ProviderInterface ...$providers)
11 {
12 $this->providers = $providers;
13 }
14
18 public function getIterator(): \ArrayIterator
19 {
20 return new \ArrayIterator($this->providers);
21 }
22
23 public function add(ProviderInterface $provider): void
24 {
25 $this->providers[] = $provider;
26 }
27
28 public function isEmpty(): bool
29 {
30 return empty($this->providers);
31 }
32
33 public function count(): int
34 {
35 return count($this->providers);
36 }
37}