Test Failed
Branch master (3f2e80)
by Gabriel
03:43 queued 01:39
created

AbstractResponseTest::newResponse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 10
rs 10
cc 2
nc 2
nop 2
1
<?php
2
3
namespace ByTIC\Omnipay\Paylike\Tests\Message;
4
5
use ByTIC\Omnipay\Paylike\Message\AbstractRequest;
6
use ByTIC\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 ByTIC\Omnipay\Paylike\Tests\Message
14
 */
15
abstract class AbstractResponseTest extends AbstractTest
16
{
17
18
    /**
19
     * @param string $class Request Class
20
     * @param array $data
21
     * @return AbstractResponse|\Omnipay\Common\Message\ResponseInterface
22
     */
23
    protected function newResponse($class, $data = [])
24
    {
25
        $client = $this->getHttpClient();
0 ignored issues
show
Bug introduced by
The method getHttpClient() does not exist on ByTIC\Omnipay\Paylike\Te...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

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