| Total Complexity | 7 |
| Total Lines | 87 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class OctetString implements TaggableElement |
||
| 14 | { |
||
| 15 | use TaggableElementTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The value of the element. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $value; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Create a new instance. |
||
| 26 | * |
||
| 27 | * @param string $value the value of the element |
||
| 28 | * |
||
| 29 | * @return static |
||
| 30 | */ |
||
| 31 | 3 | public static function create($value) |
|
| 32 | { |
||
| 33 | 3 | $result = new static(); |
|
| 34 | |||
| 35 | 3 | return $result->setValue($value); |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | * |
||
| 41 | * @see \Ocsp\Asn1\Element::getClass() |
||
| 42 | */ |
||
| 43 | 3 | public function getClass() |
|
| 44 | { |
||
| 45 | 3 | return static::CLASS_UNIVERSAL; |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | * |
||
| 51 | * @see \Ocsp\Asn1\Element::getTypeID() |
||
| 52 | */ |
||
| 53 | 3 | public function getTypeID() |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * {@inheritdoc} |
||
| 60 | * |
||
| 61 | * @see \Ocsp\Asn1\Element::isConstructed() |
||
| 62 | */ |
||
| 63 | 2 | public function isConstructed() |
|
| 64 | { |
||
| 65 | 2 | return false; |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Get the value of the element. |
||
| 70 | * |
||
| 71 | * @return string |
||
| 72 | */ |
||
| 73 | 3 | public function getValue() |
|
| 74 | { |
||
| 75 | 3 | return $this->value; |
|
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Update the value of the element. |
||
| 80 | * |
||
| 81 | * @param string $value |
||
| 82 | * |
||
| 83 | * @return $this |
||
| 84 | */ |
||
| 85 | 3 | public function setValue($value) |
|
| 86 | { |
||
| 87 | 3 | $this->value = (string) $value; |
|
| 88 | |||
| 89 | 3 | return $this; |
|
| 90 | } |
||
| 91 | |||
| 92 | /** |
||
| 93 | * {@inheritdoc} |
||
| 94 | * |
||
| 95 | * @see \Ocsp\Asn1\Element::getEncodedValue() |
||
| 96 | */ |
||
| 97 | 2 | public function getEncodedValue(Encoder $encoder) |
|
| 100 | } |
||
| 101 | } |
||
| 102 |