Parameters::dispatch()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Annotations\Parser\Ast;
6
7
use Countable;
8
use Doctrine\Annotations\Parser\Visitor\Visitor;
9
use IteratorAggregate;
10
use function count;
11
12
final class Parameters implements Node, IteratorAggregate, Countable
13
{
14
    /** @var Parameter[] */
15
    private $parameters;
16
17 28
    public function __construct(Parameter ...$parameters)
18
    {
19 28
        $this->parameters = $parameters;
20 28
    }
21
22
    /**
23
     * @return Parameter[]
24
     */
25 11
    public function getIterator() : iterable
26
    {
27 11
        yield from $this->parameters;
0 ignored issues
show
Bug Best Practice introduced by
The expression YieldFromNode returns the type Generator which is incompatible with the documented return type Doctrine\Annotations\Parser\Ast\Parameter[].
Loading history...
28 11
    }
29
30 11
    public function dispatch(Visitor $visitor) : void
31
    {
32 11
        $visitor->visitParameters($this);
33 11
    }
34
35
    public function count() : int
36
    {
37
        return count($this->parameters);
38
    }
39
}
40