| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function handle($request, Closure $next) |
||
| 26 | { |
||
| 27 | if ($slug = $request->slug) { |
||
| 28 | $sprint = Sprint::slug($slug) |
||
| 29 | ->whereDate('date_finish', '<', Carbon::now()->format('Y-m-d')) |
||
| 30 | //->whereNull('closed_at') |
||
| 31 | ->first(); |
||
| 32 | |||
| 33 | if ($sprint) { |
||
| 34 | $msg = trans('This Sprint has been expired at').' '.$sprint->date_finish; |
||
| 35 | view()->share('notification', ['alert' => 'danger', 'message' => $msg]); |
||
|
|
|||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | return $next($request); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
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: