1 | <?php |
||
8 | abstract class Resource extends BaseResource |
||
9 | { |
||
10 | /** @var \Resource[] */ |
||
11 | protected $subResources = []; |
||
12 | |||
13 | /** @var Transport */ |
||
14 | protected $transport; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $uri; |
||
18 | |||
19 | /** |
||
20 | * @param Transport $transport |
||
21 | * @param string $uri |
||
22 | * @param array $data |
||
23 | */ |
||
24 | public function __construct(Transport $transport, $uri, array $data = []) |
||
35 | |||
36 | /** |
||
37 | * @return string |
||
38 | */ |
||
39 | abstract protected function getEndpoint(); |
||
40 | |||
41 | protected function init() |
||
45 | |||
46 | /** |
||
47 | * @param string $suffix |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | protected function getFullUri($suffix = '') |
||
55 | |||
56 | /** |
||
57 | * @param string $name |
||
|
|||
58 | * |
||
59 | * @return Resource|\Resource[] |
||
60 | */ |
||
61 | public function getSubResources($name = null) |
||
70 | |||
71 | /** |
||
72 | * @param string[] $resourceClassNames |
||
73 | * |
||
74 | * @throws \InvalidArgumentException when class name is not a Resource |
||
75 | */ |
||
76 | protected function setSubResources(array $resourceClassNames) |
||
99 | |||
100 | /** |
||
101 | * @param array $params |
||
102 | * @param string $instanceClassName |
||
103 | * @param string $idParam |
||
104 | * |
||
105 | * @return Resource |
||
106 | */ |
||
107 | protected function getObjectFromArray(array $params, $instanceClassName = null, $idParam = 'id') |
||
125 | |||
126 | /** |
||
127 | * @param $method |
||
128 | * @param $arguments |
||
129 | * |
||
130 | * @return Resource|ResourceCollection |
||
131 | * @throws \BadMethodCallException |
||
132 | */ |
||
133 | public function __call($method, $arguments) |
||
153 | |||
154 | /** |
||
155 | * @return Transport |
||
156 | */ |
||
157 | public function getTransport() |
||
161 | } |
||
162 |
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.