Test Failed
Pull Request — develop (#4)
by Stephen
06:10
created

NcentralClientFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A factory() 0 9 1
1
<?php
2
3
namespace Spinen\Ncentral;
4
5
use Spinen\Ncentral\NcentralClient;
6
use Spinen\Ncentral\NcentralClassmap;
0 ignored issues
show
Bug introduced by
The type Spinen\Ncentral\NcentralClassmap 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...
7
use Symfony\Component\EventDispatcher\EventDispatcher;
8
use Phpro\SoapClient\Soap\Driver\ExtSoap\ExtSoapEngineFactory;
9
use Phpro\SoapClient\Soap\Driver\ExtSoap\ExtSoapOptions;
10
11
class NcentralClientFactory
12
{
13
14
    public static function factory(string $wsdl) : \Spinen\Ncentral\NcentralClient
15
    {
16
        $engine = ExtSoapEngineFactory::fromOptions(
17
            ExtSoapOptions::defaults($wsdl, [])
18
                ->withClassMap(NcentralClassmap::getCollection())
19
        );
20
        $eventDispatcher = new EventDispatcher();
21
22
        return new NcentralClient($engine, $eventDispatcher);
23
    }
24
25
26
}
27
28