| Total Complexity | 6 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 82.35% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 10 | final class NativeSessionGuard implements Guard |
||
| 11 | { |
||
| 12 | use GuardHelpers; |
||
| 13 | |||
| 14 | private $session; |
||
| 15 | |||
| 16 | private $dispatcher; |
||
| 17 | |||
| 18 | 2 | public function __construct(NativeSessionUserProvider $provider, SessionRetriever $session, Dispatcher $dispatcher) |
|
| 19 | { |
||
| 20 | 2 | $this->provider = $provider; |
|
| 21 | 2 | $this->session = $session; |
|
| 22 | 2 | $this->dispatcher = $dispatcher; |
|
| 23 | } |
||
| 24 | |||
| 25 | 2 | public function user() |
|
| 49 | } |
||
| 50 | |||
| 51 | public function validate(array $credentials = []) |
||
| 56 |
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.