1<?php 2/** 3 * This file is part of the FreeDSx ASN1 package. 4 * 5 * (c) Chad Sikorra <Chad.Sikorra@gmail.com> 6 * 7 * For the full copyright and license information, please view the LICENSE 8 * file that was distributed with this source code. 9 */ 10 11namespace FreeDSx\Asn1\Type; 12 13/** 14 * Represents an ASN1 boolean type. 15 * 16 * @author Chad Sikorra <Chad.Sikorra@gmail.com> 17 */ 18class BooleanType extends AbstractType 19{ 20 protected $tagNumber = self::TAG_TYPE_BOOLEAN; 21 22 /** 23 * @param bool $value 24 */ 25 public function __construct(bool $value) 26 { 27 parent::__construct($value); 28 } 29 30 /** 31 * @param bool $value 32 * @return $this 33 */ 34 public function setValue(bool $value) 35 { 36 $this->value = $value; 37 38 return $this; 39 } 40 41 /** 42 * @param string|int $tagNumber 43 * @param int $class 44 * @param bool $value 45 * @return BooleanType 46 */ 47 public static function withTag($tagNumber, int $class, bool $value) 48 { 49 $type = new self($value); 50 $type->taggingClass = $class; 51 $type->tagNumber = $tagNumber; 52 53 return $type; 54 } 55} 56