Completed
Push — feature/VSVGVQ-47 ( 782343...d395df )
by Luc
05:31 queued 01:55
created

Questions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 38
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A count() 0 3 1
A __construct() 0 3 1
A getIterator() 0 3 1
A toArray() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace VSV\GVQ_API\Question\Models;
4
5
use VSV\GVQ_API\Common\ValueObjects\Collection;
6
7
class Questions implements Collection
8
{
9
    /**
10
     * @var Question[]
11
     */
12
    private $questions;
13
14
    /**
15
     * Questions constructor.
16
     * @param Question ...$questions
17
     */
18
    public function __construct(Question ...$questions)
19
    {
20
        $this->questions = $questions;
21
    }
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function getIterator(): \ArrayIterator
27
    {
28
        return new \ArrayIterator($this->questions);
29
    }
30
31
    /**
32
     * @inheritdoc
33
     */
34
    public function count(): int
35
    {
36
        return count($this->questions);
37
    }
38
39
    /**
40
     * @return Question[]
41
     */
42
    public function toArray(): array
43
    {
44
        return $this->questions;
45
    }
46
}
47