Passed
Push — ref ( 45b89b )
by Asmir
02:50
created

ArrayMetadataLoader   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 7
c 0
b 0
f 0
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addMetadata() 0 3 1
A __construct() 0 3 1
A load() 0 6 2
1
<?php
2
3
namespace GoetasWebservices\SoapServices\Metadata\Loader;
4
5
use GoetasWebservices\SoapServices\Exception\MetadataException;
0 ignored issues
show
Bug introduced by
The type GoetasWebservices\SoapSe...ption\MetadataException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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