@@ -15,69 +15,69 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class ConstructedString extends Structure |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * Constructor. |
|
| 20 | - * |
|
| 21 | - * @internal Use create() |
|
| 22 | - * |
|
| 23 | - * @param Element ...$elements Any number of elements |
|
| 24 | - */ |
|
| 25 | - public function __construct(Element ...$elements) |
|
| 26 | - { |
|
| 27 | - parent::__construct(...$elements); |
|
| 28 | - } |
|
| 18 | + /** |
|
| 19 | + * Constructor. |
|
| 20 | + * |
|
| 21 | + * @internal Use create() |
|
| 22 | + * |
|
| 23 | + * @param Element ...$elements Any number of elements |
|
| 24 | + */ |
|
| 25 | + public function __construct(Element ...$elements) |
|
| 26 | + { |
|
| 27 | + parent::__construct(...$elements); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Create constructed string. |
|
| 32 | - * |
|
| 33 | - * @param int $tag Type tag |
|
| 34 | - * @param PrimitiveString ...$elements Any number of elements |
|
| 35 | - */ |
|
| 36 | - public static function create(int $tag, PrimitiveString ...$elements) |
|
| 37 | - { |
|
| 38 | - $el = new self(...$elements); |
|
| 39 | - $el->_typeTag = $tag; |
|
| 40 | - return $el; |
|
| 41 | - } |
|
| 30 | + /** |
|
| 31 | + * Create constructed string. |
|
| 32 | + * |
|
| 33 | + * @param int $tag Type tag |
|
| 34 | + * @param PrimitiveString ...$elements Any number of elements |
|
| 35 | + */ |
|
| 36 | + public static function create(int $tag, PrimitiveString ...$elements) |
|
| 37 | + { |
|
| 38 | + $el = new self(...$elements); |
|
| 39 | + $el->_typeTag = $tag; |
|
| 40 | + return $el; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Get a list of strings in this structure. |
|
| 45 | - * |
|
| 46 | - * @return string[] |
|
| 47 | - */ |
|
| 48 | - public function strings(): array |
|
| 49 | - { |
|
| 50 | - return array_map(function (PrimitiveString $el) { |
|
| 51 | - return $el->string(); |
|
| 52 | - }, $this->_elements); |
|
| 53 | - } |
|
| 43 | + /** |
|
| 44 | + * Get a list of strings in this structure. |
|
| 45 | + * |
|
| 46 | + * @return string[] |
|
| 47 | + */ |
|
| 48 | + public function strings(): array |
|
| 49 | + { |
|
| 50 | + return array_map(function (PrimitiveString $el) { |
|
| 51 | + return $el->string(); |
|
| 52 | + }, $this->_elements); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Get the contained strings concatenated together. |
|
| 57 | - * |
|
| 58 | - * @return string |
|
| 59 | - */ |
|
| 60 | - public function concatenated(): string |
|
| 61 | - { |
|
| 62 | - return implode('', $this->strings()); |
|
| 63 | - } |
|
| 55 | + /** |
|
| 56 | + * Get the contained strings concatenated together. |
|
| 57 | + * |
|
| 58 | + * @return string |
|
| 59 | + */ |
|
| 60 | + public function concatenated(): string |
|
| 61 | + { |
|
| 62 | + return implode('', $this->strings()); |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * {@inheritdoc} |
|
| 67 | - * |
|
| 68 | - * @return self |
|
| 69 | - */ |
|
| 70 | - protected static function _decodeFromDER( |
|
| 71 | - Identifier $identifier, |
|
| 72 | - string $data, |
|
| 73 | - int &$offset |
|
| 74 | - ): ElementBase { |
|
| 75 | - /** @var ConstructedString $type */ |
|
| 76 | - $type = forward_static_call_array( |
|
| 77 | - [parent::class, __FUNCTION__], |
|
| 78 | - [$identifier, $data, &$offset] |
|
| 79 | - ); |
|
| 80 | - $type->_typeTag = $identifier->intTag(); |
|
| 81 | - return $type; |
|
| 82 | - } |
|
| 65 | + /** |
|
| 66 | + * {@inheritdoc} |
|
| 67 | + * |
|
| 68 | + * @return self |
|
| 69 | + */ |
|
| 70 | + protected static function _decodeFromDER( |
|
| 71 | + Identifier $identifier, |
|
| 72 | + string $data, |
|
| 73 | + int &$offset |
|
| 74 | + ): ElementBase { |
|
| 75 | + /** @var ConstructedString $type */ |
|
| 76 | + $type = forward_static_call_array( |
|
| 77 | + [parent::class, __FUNCTION__], |
|
| 78 | + [$identifier, $data, &$offset] |
|
| 79 | + ); |
|
| 80 | + $type->_typeTag = $identifier->intTag(); |
|
| 81 | + return $type; |
|
| 82 | + } |
|
| 83 | 83 | } |