@@ -9,16 +9,16 @@ |
||
9 | 9 | |
10 | 10 | class CharacterString extends PrimitiveString |
11 | 11 | { |
12 | - use UniversalClass; |
|
12 | + use UniversalClass; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Constructor. |
|
16 | - * |
|
17 | - * @param string $string |
|
18 | - */ |
|
19 | - public function __construct(string $string) |
|
20 | - { |
|
21 | - $this->_typeTag = self::TYPE_CHARACTER_STRING; |
|
22 | - parent::__construct($string); |
|
23 | - } |
|
14 | + /** |
|
15 | + * Constructor. |
|
16 | + * |
|
17 | + * @param string $string |
|
18 | + */ |
|
19 | + public function __construct(string $string) |
|
20 | + { |
|
21 | + $this->_typeTag = self::TYPE_CHARACTER_STRING; |
|
22 | + parent::__construct($string); |
|
23 | + } |
|
24 | 24 | } |
@@ -12,26 +12,26 @@ |
||
12 | 12 | */ |
13 | 13 | class GraphicString extends PrimitiveString |
14 | 14 | { |
15 | - use UniversalClass; |
|
15 | + use UniversalClass; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Constructor. |
|
19 | - * |
|
20 | - * @param string $string |
|
21 | - */ |
|
22 | - public function __construct(string $string) |
|
23 | - { |
|
24 | - $this->_typeTag = self::TYPE_GRAPHIC_STRING; |
|
25 | - parent::__construct($string); |
|
26 | - } |
|
17 | + /** |
|
18 | + * Constructor. |
|
19 | + * |
|
20 | + * @param string $string |
|
21 | + */ |
|
22 | + public function __construct(string $string) |
|
23 | + { |
|
24 | + $this->_typeTag = self::TYPE_GRAPHIC_STRING; |
|
25 | + parent::__construct($string); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * |
|
30 | - * {@inheritdoc} |
|
31 | - */ |
|
32 | - protected function _validateString(string $string): bool |
|
33 | - { |
|
34 | - // allow everything |
|
35 | - return true; |
|
36 | - } |
|
28 | + /** |
|
29 | + * |
|
30 | + * {@inheritdoc} |
|
31 | + */ |
|
32 | + protected function _validateString(string $string): bool |
|
33 | + { |
|
34 | + // allow everything |
|
35 | + return true; |
|
36 | + } |
|
37 | 37 | } |
@@ -15,29 +15,29 @@ |
||
15 | 15 | */ |
16 | 16 | class BMPString extends PrimitiveString |
17 | 17 | { |
18 | - use UniversalClass; |
|
18 | + use UniversalClass; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Constructor. |
|
22 | - * |
|
23 | - * @param string $string |
|
24 | - */ |
|
25 | - public function __construct(string $string) |
|
26 | - { |
|
27 | - $this->_typeTag = self::TYPE_BMP_STRING; |
|
28 | - parent::__construct($string); |
|
29 | - } |
|
20 | + /** |
|
21 | + * Constructor. |
|
22 | + * |
|
23 | + * @param string $string |
|
24 | + */ |
|
25 | + public function __construct(string $string) |
|
26 | + { |
|
27 | + $this->_typeTag = self::TYPE_BMP_STRING; |
|
28 | + parent::__construct($string); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * |
|
33 | - * {@inheritdoc} |
|
34 | - */ |
|
35 | - protected function _validateString(string $string): bool |
|
36 | - { |
|
37 | - // UCS-2 has fixed with of 2 octets (16 bits) |
|
38 | - if (strlen($string) % 2 !== 0) { |
|
39 | - return false; |
|
40 | - } |
|
41 | - return true; |
|
42 | - } |
|
31 | + /** |
|
32 | + * |
|
33 | + * {@inheritdoc} |
|
34 | + */ |
|
35 | + protected function _validateString(string $string): bool |
|
36 | + { |
|
37 | + // UCS-2 has fixed with of 2 octets (16 bits) |
|
38 | + if (strlen($string) % 2 !== 0) { |
|
39 | + return false; |
|
40 | + } |
|
41 | + return true; |
|
42 | + } |
|
43 | 43 | } |
@@ -14,29 +14,29 @@ |
||
14 | 14 | */ |
15 | 15 | class UniversalString extends PrimitiveString |
16 | 16 | { |
17 | - use UniversalClass; |
|
17 | + use UniversalClass; |
|
18 | 18 | |
19 | - /** |
|
20 | - * Constructor. |
|
21 | - * |
|
22 | - * @param string $string |
|
23 | - */ |
|
24 | - public function __construct(string $string) |
|
25 | - { |
|
26 | - $this->_typeTag = self::TYPE_UNIVERSAL_STRING; |
|
27 | - parent::__construct($string); |
|
28 | - } |
|
19 | + /** |
|
20 | + * Constructor. |
|
21 | + * |
|
22 | + * @param string $string |
|
23 | + */ |
|
24 | + public function __construct(string $string) |
|
25 | + { |
|
26 | + $this->_typeTag = self::TYPE_UNIVERSAL_STRING; |
|
27 | + parent::__construct($string); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * |
|
32 | - * {@inheritdoc} |
|
33 | - */ |
|
34 | - protected function _validateString(string $string): bool |
|
35 | - { |
|
36 | - // UCS-4 has fixed with of 4 octets (32 bits) |
|
37 | - if (strlen($string) % 4 != 0) { |
|
38 | - return false; |
|
39 | - } |
|
40 | - return true; |
|
41 | - } |
|
30 | + /** |
|
31 | + * |
|
32 | + * {@inheritdoc} |
|
33 | + */ |
|
34 | + protected function _validateString(string $string): bool |
|
35 | + { |
|
36 | + // UCS-4 has fixed with of 4 octets (32 bits) |
|
37 | + if (strlen($string) % 4 != 0) { |
|
38 | + return false; |
|
39 | + } |
|
40 | + return true; |
|
41 | + } |
|
42 | 42 | } |
@@ -14,25 +14,25 @@ |
||
14 | 14 | */ |
15 | 15 | class UTF8String extends PrimitiveString |
16 | 16 | { |
17 | - use UniversalClass; |
|
17 | + use UniversalClass; |
|
18 | 18 | |
19 | - /** |
|
20 | - * Constructor. |
|
21 | - * |
|
22 | - * @param string $string |
|
23 | - */ |
|
24 | - public function __construct(string $string) |
|
25 | - { |
|
26 | - $this->_typeTag = self::TYPE_UTF8_STRING; |
|
27 | - parent::__construct($string); |
|
28 | - } |
|
19 | + /** |
|
20 | + * Constructor. |
|
21 | + * |
|
22 | + * @param string $string |
|
23 | + */ |
|
24 | + public function __construct(string $string) |
|
25 | + { |
|
26 | + $this->_typeTag = self::TYPE_UTF8_STRING; |
|
27 | + parent::__construct($string); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * |
|
32 | - * {@inheritdoc} |
|
33 | - */ |
|
34 | - protected function _validateString(string $string): bool |
|
35 | - { |
|
36 | - return mb_check_encoding($string, "UTF-8"); |
|
37 | - } |
|
30 | + /** |
|
31 | + * |
|
32 | + * {@inheritdoc} |
|
33 | + */ |
|
34 | + protected function _validateString(string $string): bool |
|
35 | + { |
|
36 | + return mb_check_encoding($string, "UTF-8"); |
|
37 | + } |
|
38 | 38 | } |
@@ -12,27 +12,27 @@ |
||
12 | 12 | */ |
13 | 13 | class T61String extends PrimitiveString |
14 | 14 | { |
15 | - use UniversalClass; |
|
15 | + use UniversalClass; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Constructor. |
|
19 | - * |
|
20 | - * @param string $string |
|
21 | - */ |
|
22 | - public function __construct(string $string) |
|
23 | - { |
|
24 | - $this->_typeTag = self::TYPE_T61_STRING; |
|
25 | - parent::__construct($string); |
|
26 | - } |
|
17 | + /** |
|
18 | + * Constructor. |
|
19 | + * |
|
20 | + * @param string $string |
|
21 | + */ |
|
22 | + public function __construct(string $string) |
|
23 | + { |
|
24 | + $this->_typeTag = self::TYPE_T61_STRING; |
|
25 | + parent::__construct($string); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * |
|
30 | - * {@inheritdoc} |
|
31 | - */ |
|
32 | - protected function _validateString(string $string): bool |
|
33 | - { |
|
34 | - // allow everything since there's literally |
|
35 | - // thousands of allowed characters (16 bit composed characters) |
|
36 | - return true; |
|
37 | - } |
|
28 | + /** |
|
29 | + * |
|
30 | + * {@inheritdoc} |
|
31 | + */ |
|
32 | + protected function _validateString(string $string): bool |
|
33 | + { |
|
34 | + // allow everything since there's literally |
|
35 | + // thousands of allowed characters (16 bit composed characters) |
|
36 | + return true; |
|
37 | + } |
|
38 | 38 | } |
@@ -12,25 +12,25 @@ |
||
12 | 12 | */ |
13 | 13 | class IA5String extends PrimitiveString |
14 | 14 | { |
15 | - use UniversalClass; |
|
15 | + use UniversalClass; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Constructor |
|
19 | - * |
|
20 | - * @param string $string |
|
21 | - */ |
|
22 | - public function __construct(string $string) |
|
23 | - { |
|
24 | - $this->_typeTag = self::TYPE_IA5_STRING; |
|
25 | - parent::__construct($string); |
|
26 | - } |
|
17 | + /** |
|
18 | + * Constructor |
|
19 | + * |
|
20 | + * @param string $string |
|
21 | + */ |
|
22 | + public function __construct(string $string) |
|
23 | + { |
|
24 | + $this->_typeTag = self::TYPE_IA5_STRING; |
|
25 | + parent::__construct($string); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * |
|
30 | - * {@inheritdoc} |
|
31 | - */ |
|
32 | - protected function _validateString(string $string): bool |
|
33 | - { |
|
34 | - return preg_match('/[^\x01-\x7f]/', $string) == 0; |
|
35 | - } |
|
28 | + /** |
|
29 | + * |
|
30 | + * {@inheritdoc} |
|
31 | + */ |
|
32 | + protected function _validateString(string $string): bool |
|
33 | + { |
|
34 | + return preg_match('/[^\x01-\x7f]/', $string) == 0; |
|
35 | + } |
|
36 | 36 | } |
@@ -12,25 +12,25 @@ |
||
12 | 12 | */ |
13 | 13 | class VisibleString extends PrimitiveString |
14 | 14 | { |
15 | - use UniversalClass; |
|
15 | + use UniversalClass; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Constructor. |
|
19 | - * |
|
20 | - * @param string $string |
|
21 | - */ |
|
22 | - public function __construct(string $string) |
|
23 | - { |
|
24 | - $this->_typeTag = self::TYPE_VISIBLE_STRING; |
|
25 | - parent::__construct($string); |
|
26 | - } |
|
17 | + /** |
|
18 | + * Constructor. |
|
19 | + * |
|
20 | + * @param string $string |
|
21 | + */ |
|
22 | + public function __construct(string $string) |
|
23 | + { |
|
24 | + $this->_typeTag = self::TYPE_VISIBLE_STRING; |
|
25 | + parent::__construct($string); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * |
|
30 | - * {@inheritdoc} |
|
31 | - */ |
|
32 | - protected function _validateString(string $string): bool |
|
33 | - { |
|
34 | - return preg_match('/[^\x20-\x7e]/', $string) == 0; |
|
35 | - } |
|
28 | + /** |
|
29 | + * |
|
30 | + * {@inheritdoc} |
|
31 | + */ |
|
32 | + protected function _validateString(string $string): bool |
|
33 | + { |
|
34 | + return preg_match('/[^\x20-\x7e]/', $string) == 0; |
|
35 | + } |
|
36 | 36 | } |
@@ -12,26 +12,26 @@ |
||
12 | 12 | */ |
13 | 13 | class ObjectDescriptor extends PrimitiveString |
14 | 14 | { |
15 | - use UniversalClass; |
|
15 | + use UniversalClass; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Constructor. |
|
19 | - * |
|
20 | - * @param string $descriptor |
|
21 | - */ |
|
22 | - public function __construct(string $descriptor) |
|
23 | - { |
|
24 | - $this->_string = $descriptor; |
|
25 | - $this->_typeTag = self::TYPE_OBJECT_DESCRIPTOR; |
|
26 | - } |
|
17 | + /** |
|
18 | + * Constructor. |
|
19 | + * |
|
20 | + * @param string $descriptor |
|
21 | + */ |
|
22 | + public function __construct(string $descriptor) |
|
23 | + { |
|
24 | + $this->_string = $descriptor; |
|
25 | + $this->_typeTag = self::TYPE_OBJECT_DESCRIPTOR; |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Get the object descriptor. |
|
30 | - * |
|
31 | - * @return string |
|
32 | - */ |
|
33 | - public function descriptor(): string |
|
34 | - { |
|
35 | - return $this->_string; |
|
36 | - } |
|
28 | + /** |
|
29 | + * Get the object descriptor. |
|
30 | + * |
|
31 | + * @return string |
|
32 | + */ |
|
33 | + public function descriptor(): string |
|
34 | + { |
|
35 | + return $this->_string; |
|
36 | + } |
|
37 | 37 | } |