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

NcentralClientFactory::factory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
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