| Total Complexity | 8 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class BitMask |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | private array $entity; |
||
| 18 | |||
| 19 | private $field; |
||
| 20 | private $isEnabled; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * SpellCheck constructor. |
||
| 24 | * @param array $params |
||
| 25 | */ |
||
| 26 | public function __construct(array $params) |
||
| 27 | { |
||
| 28 | $this->entity = $params; |
||
| 29 | $this->field = key($this->entity); |
||
| 30 | $this->isEnabled = empty($this->entity[$this->field][ConfigInterface::ENABLED]) ? false : true; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return boolean |
||
| 35 | */ |
||
| 36 | public function isEnabled(): bool |
||
| 37 | { |
||
| 38 | return $this->isEnabled; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return mixed|null |
||
| 43 | */ |
||
| 44 | public function getField() |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return mixed |
||
| 51 | * @throws AttributesException |
||
| 52 | */ |
||
| 53 | public function getFlags() |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Whether mask should be hidden or not |
||
| 63 | * |
||
| 64 | * @return bool |
||
| 65 | */ |
||
| 66 | public function isHidden(): bool |
||
| 69 | } |
||
| 70 | } |