Completed
Pull Request — master (#17)
by Kristof
05:58 queued 02:52
created

Languages::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace VSV\GVQ_API\Common\ValueObjects;
4
5
class Languages implements \IteratorAggregate
6
{
7
    /**
8
     * @var Language[]
9
     */
10
    private $languages;
11
12
    public function __construct()
13
    {
14
        $this->languages = [
15
            new Language('nl'),
16
            new Language('fr')
17
        ];
18
    }
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function getIterator(): \ArrayIterator
24
    {
25
        return new \ArrayIterator($this->languages);
26
    }
27
28
    /**
29
     * @return Language[]
30
     */
31
    public function toArray(): array
32
    {
33
        return $this->languages;
34
    }
35
}
36