Passed
Push — develop ( 78e2d5...9c7a10 )
by Laurent
02:42 queued 01:21
created

Suppliers   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getIterator() 0 3 1
A toArray() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Administration\Application\Supplier\ReadModel;
15
16
use Administration\Application\Protocol\Collection\CollectionProtocol;
17
18
final class Suppliers implements CollectionProtocol
19
{
20
    /**
21
     * @var Supplier[]
22
     */
23
    private array $values;
24
25
    public function __construct(Supplier ...$suppliers)
26
    {
27
        $this->values = $suppliers;
28
    }
29
30
    public function getIterator(): \ArrayIterator
31
    {
32
        return new \ArrayIterator($this->values);
33
    }
34
35
    public function toArray(): array
36
    {
37
        return $this->values;
38
    }
39
}
40