| 1 | <?php declare(strict_types=1); |
||
| 5 | final class GlobalState |
||
| 6 | { |
||
| 7 | const DEFAULT_STATE = [ |
||
| 8 | 'read' => 0, |
||
| 9 | 1 | 'write' => 0, |
|
| 10 | ]; |
||
| 11 | 1 | ||
| 12 | static protected $state = self::DEFAULT_STATE; |
||
| 13 | |||
| 14 | 1 | public static function get(): array |
|
| 18 | |||
| 19 | 1 | public static function reset() |
|
| 25 | |||
| 26 | 1 | public static function set(string $key, int $value) |
|
| 30 | 1 | ||
| 31 | 1 | public static function incr(string $key, int $value = 1) |
|
| 39 | } |
||
| 40 |