Passed
Push — master ( 2944ee...dfe2d2 )
by Asmir
02:04
created

ArrayMetadataLoader::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\SoapServices\Metadata\Loader;
6
7
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...
8
9
class ArrayMetadataLoader implements MetadataLoaderInterface
10
{
11
    /**
12
     * @var array
13
     */
14
    private $metadata = [];
15
16
    public function __construct(array $metadata)
17
    {
18
        $this->metadata = $metadata;
19
    }
20
21
    public function addMetadata(string $wsdl, array $metadata): void
22
    {
23
        $this->metadata[$wsdl] = $metadata;
24
    }
25
26
    public function load(string $wsdl): array
27
    {
28
        if (!isset($this->metadata[$wsdl])) {
29
            throw new MetadataException(sprintf('Can not load metadata information for %s', $wsdl));
30
        }
31
32
        return $this->metadata[$wsdl];
33
    }
34
}
35