Passed
Push — master ( f71dbb...d070fe )
by Radosław
02:35
created

HelperFactory::getConfig()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Radowoj\Yaah\HelperFactory;
4
5
use Radowoj\Yaah\Config;
6
use Radowoj\Yaah\Client;
7
use Radowoj\Yaah\Helper;
8
use Radowoj\Yaah\Exception;
9
10
abstract class HelperFactory
11
{
12
    protected $config = null;
13
14
    abstract protected function getSoapClient();
15
16 2
    public function create(array $configArray)
17
    {
18 2
        $this->config = new Config($configArray);
19 2
        $soapClient = $this->getSoapClient($this->config);
0 ignored issues
show
Unused Code introduced by
The call to HelperFactory::getSoapClient() has too many arguments starting with $this->config.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
20 2
        $apiClient = new Client($this->config, $soapClient);
21 2
        return new Helper($apiClient);
22
    }
23
24
}
25