1 | <?php |
||
10 | class Flag |
||
11 | { |
||
12 | public const FLAG_ABSTRACT = 0x01; |
||
13 | public const FLAG_FINAL = 0x02; |
||
14 | public const FLAG_STATIC = 0x04; |
||
15 | public const FLAG_PUBLIC = 0x10; |
||
16 | public const FLAG_PROTECTED = 0x20; |
||
17 | public const FLAG_PRIVATE = 0x40; |
||
18 | |||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | protected $flags; |
||
23 | |||
24 | /** |
||
25 | * @param int ...$flags |
||
26 | */ |
||
27 | 18 | public function __construct(int ...$flags) |
|
31 | |||
32 | /** |
||
33 | * @param int $flag |
||
34 | */ |
||
35 | 6 | public function addFlag(int $flag): void |
|
39 | |||
40 | /** |
||
41 | * @param int $flag |
||
42 | */ |
||
43 | 6 | public function removeFlag(int $flag): void |
|
47 | |||
48 | /** |
||
49 | * @param int $flag |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | 18 | public function hasFlag(int $flag): bool |
|
57 | |||
58 | /** |
||
59 | * @param array|int $flags |
||
60 | */ |
||
61 | 18 | protected function setFlags($flags): void |
|
73 | } |
||
74 |