@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $obj = clone $this; |
| 33 | 33 | usort($obj->_elements, |
| 34 | - function (Element $a, Element $b) { |
|
| 34 | + function(Element $a, Element $b) { |
|
| 35 | 35 | if ($a->typeClass() != $b->typeClass()) { |
| 36 | 36 | return $a->typeClass() < $b->typeClass() ? -1 : 1; |
| 37 | 37 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $obj = clone $this; |
| 55 | 55 | usort($obj->_elements, |
| 56 | - function (Element $a, Element $b) { |
|
| 56 | + function(Element $a, Element $b) { |
|
| 57 | 57 | $a_der = $a->toDER(); |
| 58 | 58 | $b_der = $b->toDER(); |
| 59 | 59 | return strcmp($a_der, $b_der); |
@@ -273,7 +273,7 @@ |
||
| 273 | 273 | /** |
| 274 | 274 | * Test that number is valid for this context. |
| 275 | 275 | * |
| 276 | - * @param mixed $num |
|
| 276 | + * @param string $num |
|
| 277 | 277 | * @return boolean |
| 278 | 278 | */ |
| 279 | 279 | private static function _validateNumber($num): bool |
@@ -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)->intLength(); |
@@ -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); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | * @return self |
| 64 | 64 | */ |
| 65 | 65 | protected static function _decodeFromDER(Identifier $identifier, string $data, |
| 66 | - int &$offset): ElementBase |
|
| 66 | + int & $offset): ElementBase |
|
| 67 | 67 | { |
| 68 | 68 | $idx = $offset; |
| 69 | 69 | Length::expectFromDER($data, $idx, 1); |
@@ -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()) { |