@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public static function fromASN1(Sequence $seq) { |
| 50 | 50 | $org = DisplayText::fromASN1($seq->at(0, Element::TYPE_STRING)); |
| 51 | 51 | $numbers = array_map( |
| 52 | - function (Element $el) { |
|
| 52 | + function(Element $el) { |
|
| 53 | 53 | return $el->expectType(Element::TYPE_INTEGER)->number(); |
| 54 | 54 | }, $seq->at(1, Element::TYPE_SEQUENCE)->elements()); |
| 55 | 55 | return new self($org, ...$numbers); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public function toASN1() { |
| 82 | 82 | $org = $this->_organization->toASN1(); |
| 83 | 83 | $nums = array_map( |
| 84 | - function ($number) { |
|
| 84 | + function($number) { |
|
| 85 | 85 | return new Integer($number); |
| 86 | 86 | }, $this->_numbers); |
| 87 | 87 | return new Sequence($org, new Sequence(...$nums)); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $qualifiers = array(); |
| 62 | 62 | if (count($seq) > 1) { |
| 63 | 63 | $qualifiers = array_map( |
| 64 | - function (Element $el) { |
|
| 64 | + function(Element $el) { |
|
| 65 | 65 | return PolicyQualifierInfo::fromASN1( |
| 66 | 66 | $el->expectType(Element::TYPE_SEQUENCE)); |
| 67 | 67 | }, $seq->at(1, Element::TYPE_SEQUENCE)->elements()); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $elements = array(new ObjectIdentifier($this->_oid)); |
| 156 | 156 | if (count($this->_qualifiers)) { |
| 157 | 157 | $qualifiers = array_map( |
| 158 | - function (PolicyQualifierInfo $pqi) { |
|
| 158 | + function(PolicyQualifierInfo $pqi) { |
|
| 159 | 159 | return $pqi->toASN1(); |
| 160 | 160 | }, array_values($this->_qualifiers)); |
| 161 | 161 | $elements[] = new Sequence(...$qualifiers); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public static function fromASN1(Sequence $seq) { |
| 40 | 40 | $subtrees = array_map( |
| 41 | - function (Element $el) { |
|
| 41 | + function(Element $el) { |
|
| 42 | 42 | return GeneralSubtree::fromASN1( |
| 43 | 43 | $el->expectType(Element::TYPE_SEQUENCE)); |
| 44 | 44 | }, $seq->elements()); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | throw new \LogicException("No subtrees."); |
| 69 | 69 | } |
| 70 | 70 | $elements = array_map( |
| 71 | - function (GeneralSubtree $gs) { |
|
| 71 | + function(GeneralSubtree $gs) { |
|
| 72 | 72 | return $gs->toASN1(); |
| 73 | 73 | }, $this->_subtrees); |
| 74 | 74 | 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 (Element $el) { |
|
| 41 | + function(Element $el) { |
|
| 42 | 42 | return PolicyInformation::fromASN1( |
| 43 | 43 | $el->expectType(Element::TYPE_SEQUENCE)); |
| 44 | 44 | }, Sequence::fromDER($data)->elements()); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | throw new \LogicException("No policies."); |
| 80 | 80 | } |
| 81 | 81 | $elements = array_map( |
| 82 | - function (PolicyInformation $pi) { |
|
| 82 | + function(PolicyInformation $pi) { |
|
| 83 | 83 | return $pi->toASN1(); |
| 84 | 84 | }, array_values($this->_policies)); |
| 85 | 85 | return new Sequence(...$elements); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public static function fromPEMs(PEM ...$pems) { |
| 37 | 37 | $certs = array_map( |
| 38 | - function ($pem) { |
|
| 38 | + function($pem) { |
|
| 39 | 39 | return Certificate::fromPEM($pem); |
| 40 | 40 | }, $pems); |
| 41 | 41 | return new self(...$certs); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function allOf($name) { |
| 71 | 71 | $oid = AttributeType::attrNameToOID($name); |
| 72 | 72 | $attrs = array_filter($this->_attributes, |
| 73 | - function (Attribute $attr) use ($oid) { |
|
| 73 | + function(Attribute $attr) use ($oid) { |
|
| 74 | 74 | return $attr->oid() == $oid; |
| 75 | 75 | }); |
| 76 | 76 | return array_values($attrs); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | public function withUnique(Attribute $attr) { |
| 111 | 111 | $obj = clone $this; |
| 112 | 112 | $obj->_attributes = array_filter($obj->_attributes, |
| 113 | - function (Attribute $a) use ($attr) { |
|
| 113 | + function(Attribute $a) use ($attr) { |
|
| 114 | 114 | return $a->oid() != $attr->oid(); |
| 115 | 115 | }); |
| 116 | 116 | $obj->_attributes[] = $attr; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $paths = $this->_resolvePathsToTarget($target, $intermediate); |
| 46 | 46 | // map paths to CertificationPath objects |
| 47 | 47 | return array_map( |
| 48 | - function ($certs) { |
|
| 48 | + function($certs) { |
|
| 49 | 49 | return new CertificationPath(...$certs); |
| 50 | 50 | }, $paths); |
| 51 | 51 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | throw new PathBuildingException("No certification paths."); |
| 109 | 109 | } |
| 110 | 110 | usort($paths, |
| 111 | - function ($a, $b) { |
|
| 111 | + function($a, $b) { |
|
| 112 | 112 | return count($a) < count($b) ? -1 : 1; |
| 113 | 113 | }); |
| 114 | 114 | return reset($paths); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | $seq = $el->at($idx, Element::TYPE_SEQUENCE); |
| 56 | 56 | $values = array_map( |
| 57 | - function (Element $el) { |
|
| 57 | + function(Element $el) { |
|
| 58 | 58 | return IetfAttrValue::fromASN1($el); |
| 59 | 59 | }, $seq->elements()); |
| 60 | 60 | $obj = new static(...$values); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $this->_policyAuthority->toASN1()); |
| 131 | 131 | } |
| 132 | 132 | $values = array_map( |
| 133 | - function (IetfAttrValue $val) { |
|
| 133 | + function(IetfAttrValue $val) { |
|
| 134 | 134 | return $val->toASN1(); |
| 135 | 135 | }, $this->_values); |
| 136 | 136 | $elements[] = new Sequence(...$values); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public static function fromAttributeValues(AttributeValue ...$values) { |
| 63 | 63 | $attribs = array_map( |
| 64 | - function (AttributeValue $value) { |
|
| 64 | + function(AttributeValue $value) { |
|
| 65 | 65 | return $value->toAttribute(); |
| 66 | 66 | }, $values); |
| 67 | 67 | return new self(...$attribs); |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public static function fromASN1(Sequence $seq) { |
| 77 | 77 | $attribs = array_map( |
| 78 | - function (Element $el) { |
|
| 78 | + function(Element $el) { |
|
| 79 | 79 | return Attribute::fromASN1( |
| 80 | 80 | $el->expectType(Element::TYPE_SEQUENCE)); |
| 81 | 81 | }, $seq->elements()); |
| 82 | 82 | // cast attributes |
| 83 | 83 | $attribs = array_map( |
| 84 | - function (Attribute $attr) { |
|
| 84 | + function(Attribute $attr) { |
|
| 85 | 85 | $oid = $attr->oid(); |
| 86 | 86 | if (array_key_exists($oid, self::MAP_OID_TO_CLASS)) { |
| 87 | 87 | $cls = self::MAP_OID_TO_CLASS[$oid]; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function toASN1() { |
| 191 | 191 | $elements = array_map( |
| 192 | - function (Attribute $attr) { |
|
| 192 | + function(Attribute $attr) { |
|
| 193 | 193 | return $attr->toASN1(); |
| 194 | 194 | }, array_values($this->_attributes)); |
| 195 | 195 | return new Sequence(...$elements); |