| Conditions | 3 | 
| Paths | 2 | 
| Total Lines | 15 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 25 | public function handle($request, Closure $next) | ||
| 26 |     { | ||
| 27 | $response = $next($request); | ||
| 28 | |||
| 29 |         $ref = $request->query(config('referral.ref_query')); | ||
| 30 | |||
| 31 |         if ($ref && $this->hasStoreAffiliateId($ref)) { | ||
| 32 |             $minutes = config('referral.lifetime_minutes', 0); | ||
| 33 | $cookie = $this->storeAffiliateId($ref, $minutes); | ||
| 34 | |||
| 35 | return $response->withCookie($cookie); | ||
| 36 | } | ||
| 37 | |||
| 38 | return $response; | ||
| 39 | } | ||
| 40 | |||
| 74 | 
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: