1 | <?php |
||
32 | class Example |
||
33 | { |
||
34 | |||
35 | private $data = array(); |
||
36 | |||
37 | public function __construct() |
||
41 | |||
42 | public function request($method, $path, $data = null) |
||
64 | |||
65 | /** |
||
66 | * @rest\endpoint /user |
||
67 | * @rest\method GET Get a list of all users |
||
68 | * @rest\require api_key |
||
69 | * @rest\response 200 array(string) |
||
70 | */ |
||
71 | private function getUser_data() |
||
75 | |||
76 | /** |
||
77 | * @rest\ifdef admin |
||
78 | * @rest\endpoint /user/{username} |
||
79 | * @rest\method DELETE Delete a specific user |
||
80 | * @rest\endif |
||
81 | */ |
||
82 | private function deleteUser($name) |
||
87 | |||
88 | /** |
||
89 | * @rest\ifdef root |
||
90 | * @rest\endpoint /user |
||
91 | * @rest\method DELETE Delete all users |
||
92 | * @rest\endif |
||
93 | */ |
||
94 | private function deleteAllUsers($name) |
||
99 | |||
100 | /** |
||
101 | * @rest\endpoint /user/{username} |
||
102 | * @rest\method GET Get a list of all users |
||
103 | * @rest\path String username Name of the user |
||
104 | * @rest\see self::request |
||
105 | * @todo get "errors" from self::request, without context issues; filter out methods without a @rest\method statement |
||
106 | */ |
||
107 | private function getUser($name) |
||
118 | |||
119 | private function getUserAge_data($name) |
||
123 | |||
124 | private function getUserHeight_data($name) |
||
128 | |||
129 | private function getUserHeight($name, $unit) |
||
140 | |||
141 | private function getAge_data() |
||
151 | |||
152 | /** |
||
153 | * @rest\endpoint /user/{username}/image |
||
154 | * @rest\method put |
||
155 | * @rest\consumes fileform |
||
156 | * @rest\path String username Name of the user |
||
157 | * @rest\form file File Image file (PNG, GIF or JPEG) for the user. |
||
158 | * Any transparency in the file is replaced with a white background color. |
||
159 | * Files will be cropped to a square image. |
||
160 | */ |
||
161 | private function putUserImage($name, $data) |
||
166 | |||
167 | /** |
||
168 | * @rest\endpoint /user/{username}/ip |
||
169 | * @rest\method put |
||
170 | * @rest\path String username Name of the user |
||
171 | * @rest\form ipv4 IpAddress IP address of the user |
||
172 | * @rest\response 204 |
||
173 | */ |
||
174 | private function putUserIp($name, $data) |
||
178 | |||
179 | } |
||
180 |
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..