AbstractTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A generateRequestFromFixtures() 0 8 3
1
<?php
2
3
namespace ByTIC\Payments\Stripe\Tests;
4
5
use Omnipay\Common\Http\Client;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\HttpFoundation\Request as HttpRequest;
8
9
/**
10
 * Class AbstractTest
11
 */
12
abstract class AbstractTest extends TestCase
13
{
14
    protected $object;
15
16
    /**
17
     * @var \Guzzle\Http\Client
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...
18
     */
19
    protected $client;
20
21
    /**
22
     * @param $path
23
     * @return HttpRequest
24
     */
25
    protected function generateRequestFromFixtures($path)
26
    {
27
        $httpRequest = HttpRequest::createFromGlobals();
28
        $parameters = require $path;
29
30
        $httpRequest->query->replace(isset($parameters['GET']) ? $parameters['GET'] : []);
31
        $httpRequest->request->replace(isset($parameters['POST']) ? $parameters['POST'] : []);
32
        return $httpRequest;
33
    }
34
35
    protected function setUp() : void
36
    {
37
        parent::setUp();
38
        $this->client = new Client();
0 ignored issues
show
Documentation Bug introduced by
It seems like new Omnipay\Common\Http\Client() of type Omnipay\Common\Http\Client is incompatible with the declared type Guzzle\Http\Client of property $client.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
39
//        $this->client->setConfig(
40
//            [
41
//                'curl.CURLOPT_SSL_VERIFYHOST' => false,
42
//                'curl.CURLOPT_SSL_VERIFYPEER' => false
43
//            ]
44
//        );
45
//        $this->client->setSslVerification(false, false);
46
    }
47
}
48