@@ -71,11 +71,11 @@ |
||
71 | 71 | $num = $this->_number->gmpObj(); |
72 | 72 | switch (gmp_sign($num)) { |
73 | 73 | // positive |
74 | - case 1: |
|
75 | - return self::_encodePositiveInteger($num); |
|
76 | - // negative |
|
77 | - case -1: |
|
78 | - return self::_encodeNegativeInteger($num); |
|
74 | + case 1: |
|
75 | + return self::_encodePositiveInteger($num); |
|
76 | + // negative |
|
77 | + case -1: |
|
78 | + return self::_encodeNegativeInteger($num); |
|
79 | 79 | } |
80 | 80 | // zero |
81 | 81 | return "\0"; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Type\Primitive; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1; |
6 | 6 |
@@ -408,20 +408,20 @@ discard block |
||
408 | 408 | protected static function _determineImplClass(Identifier $identifier): string |
409 | 409 | { |
410 | 410 | switch ($identifier->typeClass()) { |
411 | - case Identifier::CLASS_UNIVERSAL: |
|
412 | - $cls = self::_determineUniversalImplClass($identifier->intTag()); |
|
413 | - // constructed strings may be present in BER |
|
414 | - if ($identifier->isConstructed() && |
|
415 | - is_subclass_of($cls, PrimitiveString::class)) { |
|
416 | - $cls = ConstructedString::class; |
|
417 | - } |
|
418 | - return $cls; |
|
419 | - case Identifier::CLASS_CONTEXT_SPECIFIC: |
|
420 | - return ContextSpecificType::class; |
|
421 | - case Identifier::CLASS_APPLICATION: |
|
422 | - return ApplicationType::class; |
|
423 | - case Identifier::CLASS_PRIVATE: |
|
424 | - return PrivateType::class; |
|
411 | + case Identifier::CLASS_UNIVERSAL: |
|
412 | + $cls = self::_determineUniversalImplClass($identifier->intTag()); |
|
413 | + // constructed strings may be present in BER |
|
414 | + if ($identifier->isConstructed() && |
|
415 | + is_subclass_of($cls, PrimitiveString::class)) { |
|
416 | + $cls = ConstructedString::class; |
|
417 | + } |
|
418 | + return $cls; |
|
419 | + case Identifier::CLASS_CONTEXT_SPECIFIC: |
|
420 | + return ContextSpecificType::class; |
|
421 | + case Identifier::CLASS_APPLICATION: |
|
422 | + return ApplicationType::class; |
|
423 | + case Identifier::CLASS_PRIVATE: |
|
424 | + return PrivateType::class; |
|
425 | 425 | } |
426 | 426 | throw new \UnexpectedValueException( |
427 | 427 | sprintf('%s %d not implemented.', |
@@ -494,12 +494,12 @@ discard block |
||
494 | 494 | private function _isPseudoType(int $tag): bool |
495 | 495 | { |
496 | 496 | switch ($tag) { |
497 | - case self::TYPE_STRING: |
|
498 | - return $this instanceof StringType; |
|
499 | - case self::TYPE_TIME: |
|
500 | - return $this instanceof TimeType; |
|
501 | - case self::TYPE_CONSTRUCTED_STRING: |
|
502 | - return $this instanceof ConstructedString; |
|
497 | + case self::TYPE_STRING: |
|
498 | + return $this instanceof StringType; |
|
499 | + case self::TYPE_TIME: |
|
500 | + return $this instanceof TimeType; |
|
501 | + case self::TYPE_CONSTRUCTED_STRING: |
|
502 | + return $this instanceof ConstructedString; |
|
503 | 503 | } |
504 | 504 | return false; |
505 | 505 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Type\Constructed; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Type; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Type; |
6 | 6 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function __construct(ElementBase ...$elements) |
47 | 47 | { |
48 | 48 | $this->_elements = array_map( |
49 | - function (ElementBase $el) { |
|
49 | + function(ElementBase $el) { |
|
50 | 50 | return $el->asElement(); |
51 | 51 | }, $elements); |
52 | 52 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | { |
206 | 206 | if (!isset($this->_unspecifiedTypes)) { |
207 | 207 | $this->_unspecifiedTypes = array_map( |
208 | - function (Element $el) { |
|
208 | + function(Element $el) { |
|
209 | 209 | return new UnspecifiedType($el); |
210 | 210 | }, $this->_elements); |
211 | 211 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Type\Tagged; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Type\Primitive; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Type\Primitive; |
6 | 6 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | protected static function _implodeSubIDs(\GMP ...$subids): string |
146 | 146 | { |
147 | 147 | return implode('.', |
148 | - array_map(function ($num) { |
|
148 | + array_map(function($num) { |
|
149 | 149 | return gmp_strval($num, 10); |
150 | 150 | }, $subids)); |
151 | 151 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Sop\ASN1\Util; |
6 | 6 |