Conditions | 4 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
39 | 21 | public static function __callStatic($method, $parameters) |
|
40 | { |
||
41 | 21 | if (!self::$instance) { |
|
|
|||
42 | 1 | $username = (getenv('FASTSPRING_USERNAME') ?: config('services.fastspring.username')); |
|
43 | 1 | $password = (getenv('FASTSPRING_PASSWORD') ?: config('services.fastspring.password')); |
|
44 | |||
45 | 1 | self::$instance = new ApiClient($username, $password); |
|
46 | } |
||
47 | |||
48 | 21 | return call_user_func_array([self::$instance, $method], $parameters); |
|
49 | } |
||
51 |
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.