MetadataProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 28
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMetadata() 0 9 2
1
<?php
2
3
namespace Happyr\SerializerBundle\Metadata;
4
5
/**
6
 * This is the class that returns the data about the models.
7
 *
8
 * @author Tobias Nyholm <[email protected]>
9
 */
10
class MetadataProvider
11
{
12
    /**
13
     * @var MetadataReader[]
14
     */
15
    private $readers;
16
17
    /**
18
     * @param MetadataReader[] $readers
19
     */
20 24
    public function __construct(array $readers)
21
    {
22 24
        $this->readers = $readers;
23 24
    }
24
25
    /**
26
     * @return Metadata[]
27
     */
28 24
    public function getMetadata()
29
    {
30 24
        $metadata = [];
31 24
        foreach ($this->readers as $reader) {
32 24
            $metadata = array_merge($metadata, $reader->getMetadata());
33 24
        }
34
35 24
        return $metadata;
36
    }
37
}
38