Browse Source

Update UseApiResourceTags (fix invalid type error)

This comment:
```
* @apiResource 201 \App\Http\Resources\Advertisers\UserManagement\StaffResource
```
Throw error:
```
 Spatie\DataTransferObject\DataTransferObjectError 
 Invalid type: expected `Knuckles\Camel\Extraction\Response::status` to be of type `integer`, instead got value `201`, which is string..
```
So, to fix the added cast to integer status
yaroslawww 3 years ago
parent
commit
3b96454781
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Extracting/Strategies/Responses/UseApiResourceTags.php

+ 1 - 1
src/Extracting/Strategies/Responses/UseApiResourceTags.php

@@ -141,7 +141,7 @@ class UseApiResourceTags extends Strategy
     {
         $content = $tag->getContent();
         preg_match('/^(\d{3})?\s?([\s\S]*)$/', $content, $result);
-        $status = $result[1] ?: 0;
+        $status = (int)($result[1] ?: 0);
         $apiResourceClass = $result[2];
 
         return [$status, $apiResourceClass];