1 | <?php |
||
20 | final class ApiClient |
||
21 | { |
||
22 | /** |
||
23 | * @var HttpClient |
||
24 | */ |
||
25 | private $httpClient; |
||
26 | |||
27 | /** |
||
28 | * @var Hydrator |
||
29 | */ |
||
30 | private $hydrator; |
||
31 | |||
32 | /** |
||
33 | * @var RequestFactory |
||
34 | */ |
||
35 | private $messageFactory; |
||
36 | |||
37 | /** |
||
38 | * Construct an ApiClient instance. |
||
39 | * |
||
40 | * @param HttpClient|null $httpClient The HttpClient; if null, the auto-discover will be used |
||
41 | * @param MessageFactory|null $requestFactory The MessageFactory; if null, the auto-discover will be used |
||
42 | * @param Hydrator|null $hydrator The Hydrator to use, default to the ModelHydrator |
||
43 | */ |
||
44 | public function __construct( |
||
53 | |||
54 | /** |
||
55 | * Returns configured ApiClient from the given Configurator, Hydrator and RequestFactory. |
||
56 | * |
||
57 | * @param HttpClientConfigurator $httpClientConfigurator |
||
58 | * @param Hydrator|null $hydrator |
||
59 | * @param RequestFactory|null $requestFactory |
||
60 | * |
||
61 | * @return ApiClient |
||
62 | */ |
||
63 | public static function configure( |
||
72 | |||
73 | /** |
||
74 | * Return a client handling the Users resources. |
||
75 | * |
||
76 | * @return Api\Users |
||
77 | */ |
||
78 | public function users(): Users |
||
82 | |||
83 | /** |
||
84 | * Return a client handling the Teams resources. |
||
85 | * |
||
86 | * @return Api\Teams |
||
87 | */ |
||
88 | public function teams(): Teams |
||
92 | |||
93 | /** |
||
94 | * Return a client handling the Channels resources. |
||
95 | * |
||
96 | * @return Api\Channels |
||
97 | */ |
||
98 | public function channels(): Channels |
||
102 | |||
103 | /** |
||
104 | * Return a client handling the Posts resources. |
||
105 | * |
||
106 | * @return Api\Posts |
||
107 | */ |
||
108 | public function posts(): Posts |
||
112 | |||
113 | |||
114 | /** |
||
115 | * Return a client handling the Files resources. |
||
116 | * |
||
117 | * @return Api\Files |
||
118 | */ |
||
119 | public function files(): Files |
||
123 | } |
||
124 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.