AbstractResponseTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A newResponse() 0 10 2
1
<?php
2
3
namespace Paytic\Omnipay\Paylike\Tests\Message;
4
5
use Paytic\Omnipay\Paylike\Message\AbstractRequest;
6
use Paytic\Omnipay\Paylike\Tests\AbstractTest;
7
use Guzzle\Http\Client as HttpClient;
0 ignored issues
show
Bug introduced by
The type Guzzle\Http\Client 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...
8
use Omnipay\Common\Message\AbstractResponse;
9
use Symfony\Component\HttpFoundation\Request as HttpRequest;
10
11
/**
12
 * Class AbstractResponseTest
13
 * @package Paytic\Omnipay\Paylike\Tests\Message
14
 */
15
abstract class AbstractResponseTest extends AbstractTest
16
{
17
    /**
18
     * @param string $class Request Class
19
     * @param array $data
20
     * @return AbstractResponse|\Omnipay\Common\Message\ResponseInterface
21
     */
22
    protected function newResponse($class, $data = [])
23
    {
24
        $client = $this->getHttpClient();
0 ignored issues
show
Bug introduced by
The method getHttpClient() does not exist on Paytic\Omnipay\Paylike\T...ge\AbstractResponseTest. ( Ignorable by Annotation )

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

24
        /** @scrutinizer ignore-call */ 
25
        $client = $this->getHttpClient();

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...
25
        $request = HttpRequest::createFromGlobals();
26
        /** @var AbstractRequest $request */
27
        $request = new $class($client, $request);
28
        if ($request->sendData($data)) {
29
            return $request->getResponse();
30
        }
31
        return null;
32
    }
33
}
34