| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class IdArrayStore implements IdStoreInterface |
||
| 15 | { |
||
| 16 | /** @var array */ |
||
| 17 | protected $store = []; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param string $entityId |
||
| 21 | * @param string $id |
||
| 22 | * |
||
| 23 | * @return void |
||
| 24 | */ |
||
| 25 | public function set($entityId, $id, \DateTime $expiryTime) |
||
| 26 | { |
||
| 27 | if (false == isset($this->store[$entityId])) { |
||
|
|
|||
| 28 | $this->store[$entityId] = []; |
||
| 29 | } |
||
| 30 | $this->store[$entityId][$id] = $expiryTime; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $entityId |
||
| 35 | * @param string $id |
||
| 36 | * |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function has($entityId, $id) |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.