ArrayMetadataLoader   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 25
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addMetadata() 0 4 1
A load() 0 7 2
1
<?php
2
3
namespace GoetasWebservices\SoapServices\SoapClient\Metadata\Loader;
4
5
use GoetasWebservices\SoapServices\SoapClient\Exception\MetadataException;
6
7
class ArrayMetadataLoader implements MetadataLoaderInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    private $metadata = [];
13
14
    public function __construct(array $metadata)
15
    {
16
        $this->metadata = $metadata;
17
    }
18
19
    public function addMetadata($wsdl, array $metadata)
20
    {
21
        $this->metadata[$wsdl] = $metadata;
22
    }
23
24
    public function load($wsdl)
25
    {
26
        if (!isset($this->metadata[$wsdl])) {
27
            throw new MetadataException(sprintf("Can not load metadata information for %s", $wsdl));
28
        }
29
        return $this->metadata[$wsdl];
30
    }
31
}
32