Passed
Push — master ( 9187bd...555ece )
by steven
03:07
created

Questions   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
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
class Questions implements \IteratorAggregate
6
{
7
    /**
8
     * @var Question[]
9
     */
10
    private $questions;
11
12
    /**
13
     * Questions constructor.
14
     * @param Question ...$questions
15
     */
16
    public function __construct(Question ...$questions)
17
    {
18
        $this->questions = $questions;
19
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function getIterator(): \ArrayIterator
25
    {
26
        return new \ArrayIterator($this->questions);
27
    }
28
29
    /**
30
     * @return Question[]
31
     */
32
    public function toArray(): array
33
    {
34
        return $this->questions;
35
    }
36
}
37