@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | protected static function _fromDER($data, $critical) { |
| 33 | 33 | $attribs = array_map( |
| 34 | - function (UnspecifiedType $el) { |
|
| 34 | + function(UnspecifiedType $el) { |
|
| 35 | 35 | return Attribute::fromASN1($el->asSequence()); |
| 36 | 36 | }, Sequence::fromDER($data)->elements()); |
| 37 | 37 | if (!count($attribs)) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | throw new \LogicException("No attributes"); |
| 47 | 47 | } |
| 48 | 48 | $elements = array_map( |
| 49 | - function (Attribute $attr) { |
|
| 49 | + function(Attribute $attr) { |
|
| 50 | 50 | return $attr->toASN1(); |
| 51 | 51 | }, array_values($this->_attributes)); |
| 52 | 52 | return new Sequence(...$elements); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | protected static function _fromDER($data, $critical) { |
| 50 | 50 | $targets = array_map( |
| 51 | - function (UnspecifiedType $el) { |
|
| 51 | + function(UnspecifiedType $el) { |
|
| 52 | 52 | return Targets::fromASN1($el->asSequence()); |
| 53 | 53 | }, Sequence::fromDER($data)->elements()); |
| 54 | 54 | return new self($critical, ...$targets); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function names() { |
| 79 | 79 | $targets = array_filter($this->targets(), |
| 80 | - function (Target $target) { |
|
| 80 | + function(Target $target) { |
|
| 81 | 81 | return $target->type() == Target::TYPE_NAME; |
| 82 | 82 | }); |
| 83 | 83 | return array_values($targets); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function groups() { |
| 92 | 92 | $targets = array_filter($this->targets(), |
| 93 | - function (Target $target) { |
|
| 93 | + function(Target $target) { |
|
| 94 | 94 | return $target->type() == Target::TYPE_GROUP; |
| 95 | 95 | }); |
| 96 | 96 | return array_values($targets); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | protected function _valueASN1() { |
| 100 | 100 | $elements = array_map( |
| 101 | - function (Targets $targets) { |
|
| 101 | + function(Targets $targets) { |
|
| 102 | 102 | return $targets->toASN1(); |
| 103 | 103 | }, $this->_targets); |
| 104 | 104 | return new Sequence(...$elements); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | protected static function _fromDER($data, $critical) { |
| 38 | 38 | $dps = array_map( |
| 39 | - function (UnspecifiedType $el) { |
|
| 39 | + function(UnspecifiedType $el) { |
|
| 40 | 40 | return DistributionPoint::fromASN1($el->asSequence()); |
| 41 | 41 | }, Sequence::fromDER($data)->elements()); |
| 42 | 42 | if (!count($dps)) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | throw new \LogicException("No distribution points."); |
| 54 | 54 | } |
| 55 | 55 | $elements = array_map( |
| 56 | - function (DistributionPoint $dp) { |
|
| 56 | + function(DistributionPoint $dp) { |
|
| 57 | 57 | return $dp->toASN1(); |
| 58 | 58 | }, $this->_distributionPoints); |
| 59 | 59 | return new Sequence(...$elements); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | protected static function _fromDER($data, $critical) { |
| 40 | 40 | $policies = array_map( |
| 41 | - function (UnspecifiedType $el) { |
|
| 41 | + function(UnspecifiedType $el) { |
|
| 42 | 42 | return PolicyInformation::fromASN1($el->asSequence()); |
| 43 | 43 | }, Sequence::fromDER($data)->elements()); |
| 44 | 44 | if (!count($policies)) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | throw new \LogicException("No policies."); |
| 79 | 79 | } |
| 80 | 80 | $elements = array_map( |
| 81 | - function (PolicyInformation $pi) { |
|
| 81 | + function(PolicyInformation $pi) { |
|
| 82 | 82 | return $pi->toASN1(); |
| 83 | 83 | }, array_values($this->_policies)); |
| 84 | 84 | return new Sequence(...$elements); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public static function fromASN1(Sequence $seq) { |
| 50 | 50 | $org = DisplayText::fromASN1($seq->at(0)->asString()); |
| 51 | 51 | $numbers = array_map( |
| 52 | - function (UnspecifiedType $el) { |
|
| 52 | + function(UnspecifiedType $el) { |
|
| 53 | 53 | return $el->asInteger()->number(); |
| 54 | 54 | }, $seq->at(1) |
| 55 | 55 | ->asSequence() |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | public function toASN1() { |
| 84 | 84 | $org = $this->_organization->toASN1(); |
| 85 | 85 | $nums = array_map( |
| 86 | - function ($number) { |
|
| 86 | + function($number) { |
|
| 87 | 87 | return new Integer($number); |
| 88 | 88 | }, $this->_numbers); |
| 89 | 89 | return new Sequence($org, new Sequence(...$nums)); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $qualifiers = array(); |
| 64 | 64 | if (count($seq) > 1) { |
| 65 | 65 | $qualifiers = array_map( |
| 66 | - function (UnspecifiedType $el) { |
|
| 66 | + function(UnspecifiedType $el) { |
|
| 67 | 67 | return PolicyQualifierInfo::fromASN1($el->asSequence()); |
| 68 | 68 | }, $seq->at(1) |
| 69 | 69 | ->asSequence() |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $elements = array(new ObjectIdentifier($this->_oid)); |
| 159 | 159 | if (count($this->_qualifiers)) { |
| 160 | 160 | $qualifiers = array_map( |
| 161 | - function (PolicyQualifierInfo $pqi) { |
|
| 161 | + function(PolicyQualifierInfo $pqi) { |
|
| 162 | 162 | return $pqi->toASN1(); |
| 163 | 163 | }, array_values($this->_qualifiers)); |
| 164 | 164 | $elements[] = new Sequence(...$qualifiers); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | ->asImplicit(Element::TYPE_SEQUENCE) |
| 86 | 86 | ->asSequence(); |
| 87 | 87 | $permitted = array_map( |
| 88 | - function (UnspecifiedType $el) { |
|
| 88 | + function(UnspecifiedType $el) { |
|
| 89 | 89 | return $el->asObjectIdentifier()->oid(); |
| 90 | 90 | }, $attr_seq->elements()); |
| 91 | 91 | $idx++; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ->asImplicit(Element::TYPE_SEQUENCE) |
| 96 | 96 | ->asSequence(); |
| 97 | 97 | $excluded = array_map( |
| 98 | - function (UnspecifiedType $el) { |
|
| 98 | + function(UnspecifiedType $el) { |
|
| 99 | 99 | return $el->asObjectIdentifier()->oid(); |
| 100 | 100 | }, $attr_seq->elements()); |
| 101 | 101 | $idx++; |
@@ -192,14 +192,14 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | if (isset($this->_permittedAttrs)) { |
| 194 | 194 | $oids = array_map( |
| 195 | - function ($oid) { |
|
| 195 | + function($oid) { |
|
| 196 | 196 | return new ObjectIdentifier($oid); |
| 197 | 197 | }, $this->_permittedAttrs); |
| 198 | 198 | $elements[] = new ImplicitlyTaggedType(0, new Sequence(...$oids)); |
| 199 | 199 | } |
| 200 | 200 | if (isset($this->_excludedAttrs)) { |
| 201 | 201 | $oids = array_map( |
| 202 | - function ($oid) { |
|
| 202 | + function($oid) { |
|
| 203 | 203 | return new ObjectIdentifier($oid); |
| 204 | 204 | }, $this->_excludedAttrs); |
| 205 | 205 | $elements[] = new ImplicitlyTaggedType(1, new Sequence(...$oids)); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public static function fromASN1(Sequence $seq) { |
| 40 | 40 | $subtrees = array_map( |
| 41 | - function (UnspecifiedType $el) { |
|
| 41 | + function(UnspecifiedType $el) { |
|
| 42 | 42 | return GeneralSubtree::fromASN1($el->asSequence()); |
| 43 | 43 | }, $seq->elements()); |
| 44 | 44 | if (!count($subtrees)) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | throw new \LogicException("No subtrees."); |
| 68 | 68 | } |
| 69 | 69 | $elements = array_map( |
| 70 | - function (GeneralSubtree $gs) { |
|
| 70 | + function(GeneralSubtree $gs) { |
|
| 71 | 71 | return $gs->toASN1(); |
| 72 | 72 | }, $this->_subtrees); |
| 73 | 73 | return new Sequence(...$elements); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | protected static function _fromDER($data, $critical) { |
| 67 | 67 | $purposes = array_map( |
| 68 | - function (UnspecifiedType $el) { |
|
| 68 | + function(UnspecifiedType $el) { |
|
| 69 | 69 | return $el->asObjectIdentifier()->oid(); |
| 70 | 70 | }, Sequence::fromDER($data)->elements()); |
| 71 | 71 | return new self($critical, ...$purposes); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | protected function _valueASN1() { |
| 101 | 101 | $elements = array_map( |
| 102 | - function ($oid) { |
|
| 102 | + function($oid) { |
|
| 103 | 103 | return new ObjectIdentifier($oid); |
| 104 | 104 | }, $this->_purposes); |
| 105 | 105 | return new Sequence(...$elements); |