Completed
Pull Request — master (#1)
by Luc
06:59 queued 03:12
created

Categories   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getIterator() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace VSV\GVQ_API\Question\Models;
4
5
class Categories implements \IteratorAggregate
6
{
7
    /**
8
     * @var Category[]
9
     */
10
    private $categories;
11
12
    /**
13
     * @param Category ...$categories
14
     */
15
    public function __construct(Category ...$categories)
16
    {
17
        $this->categories = $categories;
18
    }
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function getIterator(): \ArrayIterator
24
    {
25
        return new \ArrayIterator($this->categories);
26
    }
27
}
28