DriversAbstract::getClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Vinelab\UrlShortener\Base;
4
5
/**
6
 * Class DriversAbstract
7
 * Every Driver must extend from the DriversAbstract which holds
8
 * the common functionality between all the drivers.
9
 *
10
 * @category Drivers Abstract
11
 *
12
 * @author  Mahmoud Zalt <[email protected]>
13
 */
14
abstract class DriversAbstract
15
{
16
    /**
17
     * @var Client Adapter
18
     */
19
    protected $clientAdapter;
20
21
    /**
22
     * @var HTTP Client instance
23
     */
24
    protected $client;
25
26
    public function __construct()
27
    {
28
        $this->clientAdapter = new ClientAdapter();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Vinelab\UrlShortener\Base\ClientAdapter() of type object<Vinelab\UrlShortener\Base\ClientAdapter> is incompatible with the declared type object<Vinelab\UrlShortener\Base\Client> of property $clientAdapter.

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...
29
    }
30
31
    /**
32
     * @param $httpClient
33
     */
34
    public function setClient($httpClient)
35
    {
36
        $this->clientAdapter->setClient($httpClient);
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getClient()
43
    {
44
        return $this->clientAdapter->getClient();
45
    }
46
47
    /**
48
     * @param $url
49
     * @param $parameters
50
     *
51
     * @return mixed
52
     */
53
    public function fetchUrl($url, $parameters)
54
    {
55
        return $this->clientAdapter->fetchUrl($url, $parameters);
56
    }
57
}
58