Passed
Push — master ( 77a008...d4a36d )
by
unknown
01:41
created
src/Response.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,6 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 namespace PhpRestfulApiResponse;
10 10
 
11
+use InvalidArgumentException;
11 12
 use League\Fractal\Manager;
12 13
 use League\Fractal\Pagination\Cursor;
13 14
 use League\Fractal\Resource\Collection;
@@ -15,7 +16,6 @@  discard block
 block discarded – undo
15 16
 use League\Fractal\TransformerAbstract;
16 17
 use PhpRestfulApiResponse\Contracts\PhpRestfulApiResponse;
17 18
 use Zend\Diactoros\MessageTrait;
18
-use InvalidArgumentException;
19 19
 
20 20
 class Response implements PhpRestfulApiResponse
21 21
 {
Please login to merge, or discard this patch.
Doc Comments   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     }
177 177
 
178 178
     /**
179
-     * @param $data
179
+     * @param Tests\unit\Lib\Book $data
180 180
      * @param TransformerAbstract|callable $transformer
181 181
      * @param int $code
182 182
      * @param null $resourceKey
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     }
201 201
 
202 202
     /**
203
-     * @param $data
203
+     * @param Tests\unit\Lib\Book[] $data
204 204
      * @param TransformerAbstract|callable $transformer
205 205
      * @param int $code
206 206
      * @param null $resourceKey
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      * @param string|array $message
235 235
      * @param int $code
236 236
      * @param array  $headers
237
-     * @return mixed
237
+     * @return Response
238 238
      */
239 239
     public function withError($message, $code, array $headers = [])
240 240
     {
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      *
262 262
      * @param string $message
263 263
      * @param array  $headers
264
-     * @return mixed
264
+     * @return Response
265 265
      */
266 266
     public function errorForbidden(string $message = '', array $headers = [])
267 267
     {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
      *
274 274
      * @param string $message
275 275
      * @param array  $headers
276
-     * @return mixed
276
+     * @return Response
277 277
      */
278 278
     public function errorInternalError(string $message = '', array $headers = [])
279 279
     {
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      *
286 286
      * @param string $message
287 287
      * @param array  $headers
288
-     * @return mixed
288
+     * @return Response
289 289
      */
290 290
     public function errorNotFound(string $message = '', array $headers = [])
291 291
     {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
      *
298 298
      * @param string $message
299 299
      * @param array $headers
300
-     * @return mixed
300
+     * @return Response
301 301
      */
302 302
     public function errorUnauthorized(string $message = '', array $headers = [])
303 303
     {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      *
310 310
      * @param array $message
311 311
      * @param array $headers
312
-     * @return mixed
312
+     * @return Response
313 313
      */
314 314
     public function errorWrongArgs(array $message, array $headers = [])
315 315
     {
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
      *
322 322
      * @param string $message
323 323
      * @param array $headers
324
-     * @return mixed
324
+     * @return Response
325 325
      */
326 326
     public function errorGone(string $message = '', array $headers = [])
327 327
     {
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
      *
334 334
      * @param string $message
335 335
      * @param array $headers
336
-     * @return mixed
336
+     * @return Response
337 337
      */
338 338
     public function errorMethodNotAllowed(string $message = '', array $headers = [])
339 339
     {
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      *
346 346
      * @param string $message
347 347
      * @param array $headers
348
-     * @return mixed
348
+     * @return Response
349 349
      */
350 350
     public function errorUnwillingToProcess(string $message = '', array $headers = [])
351 351
     {
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      *
358 358
      * @param string $message
359 359
      * @param array $headers
360
-     * @return mixed
360
+     * @return Response
361 361
      */
362 362
     public function errorUnprocessable(string $message = '', array $headers = [])
363 363
     {
Please login to merge, or discard this patch.
tests/unit/ResponseTest.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 
9 9
 namespace PhpRestfulApiResponse\Tests\unit;
10 10
 
11
+use InvalidArgumentException;
11 12
 use PhpRestfulApiResponse\Response;
12 13
 use PhpRestfulApiResponse\Tests\unit\Lib\Book;
13 14
 use ReflectionClass;
14
-use InvalidArgumentException;
15 15
 
16 16
 class ResponseTest extends Base
17 17
 {
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -284,6 +284,9 @@  discard block
 block discarded – undo
284 284
         $this->run_setStatusCode($this->getMethodSetStatusCode(), 200);
285 285
     }
286 286
 
287
+    /**
288
+     * @param integer $code
289
+     */
287 290
     private function run_setStatusCode(\ReflectionMethod $method, $code)
288 291
     {
289 292
         try {
@@ -306,6 +309,9 @@  discard block
 block discarded – undo
306 309
     }
307 310
 
308 311
 
312
+    /**
313
+     * @param integer $code
314
+     */
309 315
     private function withError(Response $response, $code, $message = null)
310 316
     {
311 317
         $this->assertEquals($code, $response->getStatusCode());
Please login to merge, or discard this patch.