Parameters   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
wmc 4
eloc 5
dl 0
loc 26
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A dispatch() 0 3 1
A count() 0 3 1
A getIterator() 0 3 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