| 1 | <?php |
||
| 7 | class DigitalOceanAccessToken extends AccessToken |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $scope; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $info; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @inheritDoc |
||
| 21 | */ |
||
| 22 | 6 | public function __construct(array $options = []) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @return string[] |
||
| 35 | */ |
||
| 36 | 3 | public function getScopes() |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @return array|null |
||
| 46 | */ |
||
| 47 | 3 | public function getInfo() |
|
| 51 | |||
| 52 | /** |
||
| 53 | * @param string $scope |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | 3 | public function hasScope($scope) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * @inheritdoc |
||
| 69 | */ |
||
| 70 | public function jsonSerialize() |
||
| 84 | } |
||
| 85 |
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.