@@ -274,7 +274,7 @@ |
||
| 274 | 274 | /** |
| 275 | 275 | * Test that number is valid for this context. |
| 276 | 276 | * |
| 277 | - * @param mixed $num |
|
| 277 | + * @param string $num |
|
| 278 | 278 | * @return bool |
| 279 | 279 | */ |
| 280 | 280 | private static function _validateNumber($num): bool |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * {@inheritdoc} |
| 19 | 19 | */ |
| 20 | 20 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
| 21 | - int &$offset): ElementBase |
|
| 21 | + int & $offset): ElementBase |
|
| 22 | 22 | { |
| 23 | 23 | $idx = $offset; |
| 24 | 24 | $type = new self($identifier, $data, $idx); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * {@inheritdoc} |
| 19 | 19 | */ |
| 20 | 20 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
| 21 | - int &$offset): ElementBase |
|
| 21 | + int & $offset): ElementBase |
|
| 22 | 22 | { |
| 23 | 23 | $idx = $offset; |
| 24 | 24 | $type = new self($identifier, $data, $idx); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @var array |
| 62 | 62 | */ |
| 63 | - const MAP_TAG_TO_CLASS = [ /* @formatter:off */ |
|
| 63 | + const MAP_TAG_TO_CLASS = [/* @formatter:off */ |
|
| 64 | 64 | self::TYPE_BOOLEAN => Primitive\Boolean::class, |
| 65 | 65 | self::TYPE_INTEGER => Primitive\Integer::class, |
| 66 | 66 | self::TYPE_BIT_STRING => Primitive\BitString::class, |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * |
| 116 | 116 | * @var array |
| 117 | 117 | */ |
| 118 | - const MAP_TYPE_TO_NAME = [ /* @formatter:off */ |
|
| 118 | + const MAP_TYPE_TO_NAME = [/* @formatter:off */ |
|
| 119 | 119 | self::TYPE_EOC => "EOC", |
| 120 | 120 | self::TYPE_BOOLEAN => "BOOLEAN", |
| 121 | 121 | self::TYPE_INTEGER => "INTEGER", |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @return self |
| 192 | 192 | */ |
| 193 | 193 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
| 194 | - int &$offset): ElementBase |
|
| 194 | + int & $offset): ElementBase |
|
| 195 | 195 | { |
| 196 | 196 | throw new \BadMethodCallException( |
| 197 | 197 | __METHOD__ . " must be implemented in derived class."); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * type, but decoding yields another type |
| 211 | 211 | * @return ElementBase |
| 212 | 212 | */ |
| 213 | - public static function fromDER(string $data, int &$offset = null): ElementBase |
|
| 213 | + public static function fromDER(string $data, int & $offset = null): ElementBase |
|
| 214 | 214 | { |
| 215 | 215 | // decode identifier |
| 216 | 216 | $idx = $offset ?? 0; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @throws DecodeException If decoding fails |
| 51 | 51 | * @return self |
| 52 | 52 | */ |
| 53 | - public static function fromDER(string $data, int &$offset = null): self |
|
| 53 | + public static function fromDER(string $data, int & $offset = null): self |
|
| 54 | 54 | { |
| 55 | 55 | $idx = $offset ?? 0; |
| 56 | 56 | $datalen = strlen($data); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @return string Integer as a string |
| 90 | 90 | */ |
| 91 | 91 | private static function _decodeLongFormLength(int $length, string $data, |
| 92 | - int &$offset): string |
|
| 92 | + int & $offset): string |
|
| 93 | 93 | { |
| 94 | 94 | // first octet must not be 0xff (spec 8.1.3.5c) |
| 95 | 95 | if ($length == 127) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @throws DecodeException If decoding or expectation fails |
| 118 | 118 | * @return self |
| 119 | 119 | */ |
| 120 | - public static function expectFromDER(string $data, int &$offset, |
|
| 120 | + public static function expectFromDER(string $data, int & $offset, |
|
| 121 | 121 | int $expected = null): self |
| 122 | 122 | { |
| 123 | 123 | $idx = $offset; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var array |
| 28 | 28 | */ |
| 29 | - const MAP_CLASS_TO_NAME = [ /* @formatter:off */ |
|
| 29 | + const MAP_CLASS_TO_NAME = [/* @formatter:off */ |
|
| 30 | 30 | self::CLASS_UNIVERSAL => "UNIVERSAL", |
| 31 | 31 | self::CLASS_APPLICATION => "APPLICATION", |
| 32 | 32 | self::CLASS_CONTEXT_SPECIFIC => "CONTEXT SPECIFIC", |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @throws DecodeException If decoding fails |
| 85 | 85 | * @return self |
| 86 | 86 | */ |
| 87 | - public static function fromDER(string $data, int &$offset = null): Identifier |
|
| 87 | + public static function fromDER(string $data, int & $offset = null): Identifier |
|
| 88 | 88 | { |
| 89 | 89 | $idx = $offset ?? 0; |
| 90 | 90 | $datalen = strlen($data); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @throws DecodeException If decoding fails |
| 118 | 118 | * @return string Tag number |
| 119 | 119 | */ |
| 120 | - private static function _decodeLongFormTag(string $data, int &$offset): string |
|
| 120 | + private static function _decodeLongFormTag(string $data, int & $offset): string |
|
| 121 | 121 | { |
| 122 | 122 | $datalen = strlen($data); |
| 123 | 123 | $tag = gmp_init(0, 10); |