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

Questions::count()   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\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