We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | [ |
||
| 45 | 'error_code' => 404, |
||
| 46 | 'error_message' => 'Campaign not found!' |
||
| 47 | ], 404 |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | return response()->json( |
||
| 52 | [ |
||
| 53 | 'title' => $campaign->title, |
||
| 54 | 'owner' => [ |
||
| 55 | 'first_name' => $campaign->owner->first_name, |
||
| 56 | 'last_name' => $campaign->owner->last_name, |
||
| 57 | 'username' => $campaign->owner->username |
||
| 58 | ], |
||
| 59 | 'dates' => [ |
||
| 60 | 'start_at' => $campaign->created_at->format('Y-m-d h:m:s'), |
||
| 61 | 'finish_at' => $campaign->expires |
||
| 62 | ] |
||
| 63 | ], 200 |
||
| 64 | ); |
||
| 65 | |||
| 66 | } |
||
| 67 | |||
| 68 | } |
||
| 69 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: