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

HelperFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
getSoapClient() 0 1 ?
A create() 0 7 1
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