@@ -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 self |
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 ? $offset : 0; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @var array |
27 | 27 | */ |
28 | - const MAP_CLASS_TO_NAME = [ /* @formatter:off */ |
|
28 | + const MAP_CLASS_TO_NAME = [/* @formatter:off */ |
|
29 | 29 | self::CLASS_UNIVERSAL => "UNIVERSAL", |
30 | 30 | self::CLASS_APPLICATION => "APPLICATION", |
31 | 31 | self::CLASS_CONTEXT_SPECIFIC => "CONTEXT SPECIFIC", |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @throws DecodeException If decoding fails |
84 | 84 | * @return self |
85 | 85 | */ |
86 | - public static function fromDER(string $data, int &$offset = null): self |
|
86 | + public static function fromDER(string $data, int & $offset = null): self |
|
87 | 87 | { |
88 | 88 | $idx = $offset ? $offset : 0; |
89 | 89 | $datalen = strlen($data); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @throws DecodeException If decoding fails |
117 | 117 | * @return string Tag number |
118 | 118 | */ |
119 | - private static function _decodeLongFormTag(string $data, int &$offset): string |
|
119 | + private static function _decodeLongFormTag(string $data, int & $offset): string |
|
120 | 120 | { |
121 | 121 | $datalen = strlen($data); |
122 | 122 | $tag = gmp_init(0, 10); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @throws DecodeException If decoding fails |
50 | 50 | * @return self |
51 | 51 | */ |
52 | - public static function fromDER(string $data, int &$offset = null): self |
|
52 | + public static function fromDER(string $data, int & $offset = null): self |
|
53 | 53 | { |
54 | 54 | $idx = $offset ? $offset : 0; |
55 | 55 | $datalen = strlen($data); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return string Integer as a string |
89 | 89 | */ |
90 | 90 | private static function _decodeLongFormLength(int $length, string $data, |
91 | - int &$offset): string |
|
91 | + int & $offset): string |
|
92 | 92 | { |
93 | 93 | // first octet must not be 0xff (spec 8.1.3.5c) |
94 | 94 | 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; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * {@inheritdoc} |
23 | 23 | */ |
24 | 24 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
25 | - int &$offset): ElementBase |
|
25 | + int & $offset): ElementBase |
|
26 | 26 | { |
27 | 27 | $idx = $offset; |
28 | 28 | $type = new DERTaggedType($identifier, $data, $idx); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return self |
92 | 92 | */ |
93 | 93 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
94 | - int &$offset): ElementBase |
|
94 | + int & $offset): ElementBase |
|
95 | 95 | { |
96 | 96 | $idx = $offset; |
97 | 97 | if (!$identifier->isConstructed()) { |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | { |
237 | 237 | if (!isset($this->_unspecifiedTypes)) { |
238 | 238 | $this->_unspecifiedTypes = array_map( |
239 | - function (Element $el) { |
|
239 | + function(Element $el) { |
|
240 | 240 | return new UnspecifiedType($el); |
241 | 241 | }, $this->_elements); |
242 | 242 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * @return self |
34 | 34 | */ |
35 | 35 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
36 | - int &$offset): ElementBase |
|
36 | + int & $offset): ElementBase |
|
37 | 37 | { |
38 | 38 | $idx = $offset; |
39 | 39 | if (!$identifier->isPrimitive()) { |
@@ -179,7 +179,7 @@ |
||
179 | 179 | * @return self |
180 | 180 | */ |
181 | 181 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
182 | - int &$offset): ElementBase |
|
182 | + int & $offset): ElementBase |
|
183 | 183 | { |
184 | 184 | $idx = $offset; |
185 | 185 | $length = Length::expectFromDER($data, $idx); |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | * @link http://php.net/manual/en/language.types.float.php |
34 | 34 | * @var string |
35 | 35 | */ |
36 | - const PHP_EXPONENT_DNUM = '/^'. /* @formatter:off */ |
|
37 | - '([+\-]?'. // sign |
|
38 | - '(?:'. |
|
39 | - '\d+'. // LNUM |
|
40 | - '|'. |
|
41 | - '(?:\d*\.\d+|\d+\.\d*)'. // DNUM |
|
42 | - '))[eE]'. |
|
43 | - '([+\-]?\d+)'. // exponent |
|
36 | + const PHP_EXPONENT_DNUM = '/^' . /* @formatter:off */ |
|
37 | + '([+\-]?' . // sign |
|
38 | + '(?:' . |
|
39 | + '\d+' . // LNUM |
|
40 | + '|' . |
|
41 | + '(?:\d*\.\d+|\d+\.\d*)' . // DNUM |
|
42 | + '))[eE]' . |
|
43 | + '([+\-]?\d+)' . // exponent |
|
44 | 44 | '$/'; /* @formatter:on */ |
45 | 45 | |
46 | 46 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @return self |
116 | 116 | */ |
117 | 117 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
118 | - int &$offset): ElementBase |
|
118 | + int & $offset): ElementBase |
|
119 | 119 | { |
120 | 120 | $idx = $offset; |
121 | 121 | $length = Length::expectFromDER($data, $idx); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * @return self |
44 | 44 | */ |
45 | 45 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
46 | - int &$offset): ElementBase |
|
46 | + int & $offset): ElementBase |
|
47 | 47 | { |
48 | 48 | $idx = $offset; |
49 | 49 | if (!$identifier->isPrimitive()) { |