1 | <?php namespace Arcanedev\SpamBlocker\Http\Middleware; |
||
13 | class BlockReferralSpam |
||
14 | { |
||
15 | /* ----------------------------------------------------------------- |
||
16 | | Properties |
||
17 | | ----------------------------------------------------------------- |
||
18 | */ |
||
19 | |||
20 | /** @var \Arcanedev\SpamBlocker\Contracts\SpamBlocker */ |
||
21 | protected $blocker; |
||
22 | |||
23 | /* ----------------------------------------------------------------- |
||
24 | | Constructor |
||
25 | | ----------------------------------------------------------------- |
||
26 | */ |
||
27 | |||
28 | /** |
||
29 | * BlockReferralSpam constructor. |
||
30 | * |
||
31 | * @param \Arcanedev\SpamBlocker\Contracts\SpamBlocker $blocker |
||
32 | */ |
||
33 | 9 | public function __construct(SpamBlocker $blocker) |
|
37 | |||
38 | /* ----------------------------------------------------------------- |
||
39 | | Main Methods |
||
40 | | ----------------------------------------------------------------- |
||
41 | */ |
||
42 | |||
43 | /** |
||
44 | * Handle an incoming request. |
||
45 | * |
||
46 | * @param \Illuminate\Http\Request $request |
||
47 | * @param \Closure $next |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | 9 | public function handle(Request $request, Closure $next) |
|
59 | |||
60 | /* ----------------------------------------------------------------- |
||
61 | | Other Methods |
||
62 | | ----------------------------------------------------------------- |
||
63 | */ |
||
64 | |||
65 | /** |
||
66 | * Get the blocked referer's response. |
||
67 | * |
||
68 | * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response |
||
69 | */ |
||
70 | 6 | protected function getBlockedResponse() |
|
74 | } |
||
75 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.