ApiObjectResponseFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 12
ccs 2
cts 6
cp 0.3333
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 5 1
A addVariantResponse() 0 3 1
1
<?php
2
3
namespace PhpWinTools\WmiScripting\Testing\Responses;
4
5
use PhpWinTools\WmiScripting\Configuration\Config;
6
use PhpWinTools\WmiScripting\Testing\Support\VARIANTFake;
7
8
class ApiObjectResponseFactory
9
{
10
    public static function add($api_object, $method, $response, Config $config = null)
11
    {
12
        $config = $config ?? Config::testInstance();
13
14
        $config->addResolvable("{$api_object}.{$method}", $response);
15
    }
16
17 2
    public static function addVariantResponse($api_object, $method, $response, Config $config = null)
18
    {
19 2
        $config->addResolvable("{$api_object}.{$method}", VARIANTFake::withResponse($method, $response));
0 ignored issues
show
Bug introduced by
The method addResolvable() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        $config->/** @scrutinizer ignore-call */ 
20
                 addResolvable("{$api_object}.{$method}", VARIANTFake::withResponse($method, $response));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
20 2
    }
21
}
22