Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | trait DeterminesGeoAccess |
||
9 | { |
||
10 | /** |
||
11 | * Get the countries. |
||
12 | * |
||
13 | * @return string[] |
||
14 | */ |
||
15 | abstract public function getCountries(); |
||
16 | |||
17 | /** |
||
18 | * Get the strategy. |
||
19 | * |
||
20 | * @return string |
||
21 | */ |
||
22 | abstract public function getStrategy(); |
||
23 | |||
24 | /** |
||
25 | * Determine if the request should be allowed through. |
||
26 | * |
||
27 | * @param \Illuminate\Http\Request $request |
||
28 | * @return bool |
||
29 | */ |
||
30 | 21 | public function shouldHaveAccess(Request $request) |
|
48 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.