1 | <?php |
||
15 | abstract class AbstractClient |
||
16 | { |
||
17 | /** |
||
18 | * The HTTP client. |
||
19 | * |
||
20 | * @var \Http\Client\HttpClient |
||
21 | */ |
||
22 | private $httpClient; |
||
23 | |||
24 | /** |
||
25 | * The HTTP message factory. |
||
26 | * |
||
27 | * @var \Http\Message\MessageFactory|null |
||
28 | */ |
||
29 | private $messageFactory; |
||
30 | |||
31 | /** |
||
32 | * AbstractClient constructor. |
||
33 | * |
||
34 | * @param \Http\Client\HttpClient $client |
||
|
|||
35 | * @param \Http\Message\MessageFactory|null $messageFactory |
||
36 | * |
||
37 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
38 | */ |
||
39 | 9 | public function __construct(HttpClient $client = null, MessageFactory $messageFactory = null) |
|
44 | |||
45 | /** |
||
46 | * @param \Http\Client\HttpClient $httpClient |
||
47 | * |
||
48 | * @return \drupol\Yaroc\Http\AbstractClient |
||
49 | */ |
||
50 | 4 | public function withHttpClient(HttpClient $httpClient) :AbstractClient |
|
57 | |||
58 | /** |
||
59 | * Returns the HTTP adapter. |
||
60 | * |
||
61 | * @return HttpClient |
||
62 | */ |
||
63 | 4 | public function getHttpClient(): HttpClient |
|
67 | |||
68 | /** |
||
69 | * Get the message factory. |
||
70 | * |
||
71 | * @return MessageFactory |
||
72 | */ |
||
73 | 4 | public function getMessageFactory(): MessageFactory |
|
77 | } |
||
78 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.