UriCollectionDescriptor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValues() 0 4 1
A getIterator() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Description\Descriptor;
6
7
use Psi\Component\Description\DescriptorInterface;
8
9
class UriCollectionDescriptor implements DescriptorInterface, \IteratorAggregate
10
{
11
    private $uris;
12
13
    public function __construct(array $uris)
14
    {
15
        $this->uris = $uris;
16
    }
17
18
    /**
19
     * Return an array of URIs. Note that the keys
20
     * CAN be the class FQN of the object to which the URI
21
     * is related.
22
     */
23
    public function getValues(): array
24
    {
25
        return $this->uris;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getIterator()
32
    {
33
        return new \ArrayIterator($this->uris);
34
    }
35
}
36