| 1 | <?php |
||
| 17 | */ |
||
| 18 | class Boolean extends Element |
||
| 19 | { |
||
| 20 | use UniversalClass; |
||
| 21 | use PrimitiveType; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Value. |
||
| 25 | * |
||
| 26 | * @var bool |
||
| 27 | */ |
||
| 28 | private $_bool; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Constructor. |
||
| 32 | * |
||
| 33 | * @param bool $bool |
||
| 34 | */ |
||
| 35 | 33 | public function __construct(bool $bool) |
|
| 36 | { |
||
| 37 | 33 | $this->_typeTag = self::TYPE_BOOLEAN; |
|
| 38 | 33 | $this->_bool = $bool; |
|
| 39 | 33 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Get the value. |
||
| 43 | * |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | 2 | public function value(): bool |
|
| 47 | { |
||
| 48 | 2 | return $this->_bool; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * {@inheritdoc} |
||
| 53 | */ |
||
| 54 | 6 | protected function _encodedContentDER(): string |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * {@inheritdoc} |
||
| 61 | */ |
||
| 62 | 8 | protected static function _decodeFromDER(Identifier $identifier, |
|
| 76 | } |
||
| 77 | } |
||
| 78 |