MetadataProvider::getMetadata()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
cc 2
eloc 5
nc 2
nop 0
crap 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