@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ->asImplicit(Element::TYPE_SEQUENCE) |
| 92 | 92 | ->asSequence(); |
| 93 | 93 | $permitted = array_map( |
| 94 | - function (UnspecifiedType $el) { |
|
| 94 | + function(UnspecifiedType $el) { |
|
| 95 | 95 | return $el->asObjectIdentifier()->oid(); |
| 96 | 96 | }, $attr_seq->elements()); |
| 97 | 97 | $idx++; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ->asImplicit(Element::TYPE_SEQUENCE) |
| 102 | 102 | ->asSequence(); |
| 103 | 103 | $excluded = array_map( |
| 104 | - function (UnspecifiedType $el) { |
|
| 104 | + function(UnspecifiedType $el) { |
|
| 105 | 105 | return $el->asObjectIdentifier()->oid(); |
| 106 | 106 | }, $attr_seq->elements()); |
| 107 | 107 | $idx++; |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | if (isset($this->_permittedAttrs)) { |
| 213 | 213 | $oids = array_map( |
| 214 | - function ($oid) { |
|
| 214 | + function($oid) { |
|
| 215 | 215 | return new ObjectIdentifier($oid); |
| 216 | 216 | }, $this->_permittedAttrs); |
| 217 | 217 | $elements[] = new ImplicitlyTaggedType(0, new Sequence(...$oids)); |
| 218 | 218 | } |
| 219 | 219 | if (isset($this->_excludedAttrs)) { |
| 220 | 220 | $oids = array_map( |
| 221 | - function ($oid) { |
|
| 221 | + function($oid) { |
|
| 222 | 222 | return new ObjectIdentifier($oid); |
| 223 | 223 | }, $this->_excludedAttrs); |
| 224 | 224 | $elements[] = new ImplicitlyTaggedType(1, new Sequence(...$oids)); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $qualifiers = array(); |
| 65 | 65 | if (count($seq) > 1) { |
| 66 | 66 | $qualifiers = array_map( |
| 67 | - function (UnspecifiedType $el) { |
|
| 67 | + function(UnspecifiedType $el) { |
|
| 68 | 68 | return PolicyQualifierInfo::fromASN1($el->asSequence()); |
| 69 | 69 | }, |
| 70 | 70 | $seq->at(1) |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $elements = array(new ObjectIdentifier($this->_oid)); |
| 189 | 189 | if (count($this->_qualifiers)) { |
| 190 | 190 | $qualifiers = array_map( |
| 191 | - function (PolicyQualifierInfo $pqi) { |
|
| 191 | + function(PolicyQualifierInfo $pqi) { |
|
| 192 | 192 | return $pqi->toASN1(); |
| 193 | 193 | }, array_values($this->_qualifiers)); |
| 194 | 194 | $elements[] = new Sequence(...$qualifiers); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $oid = AttributeType::attrNameToOID($name); |
| 75 | 75 | $attrs = array_filter($this->_attributes, |
| 76 | - function (Attribute $attr) use ($oid) { |
|
| 76 | + function(Attribute $attr) use ($oid) { |
|
| 77 | 77 | return $attr->oid() == $oid; |
| 78 | 78 | }); |
| 79 | 79 | return array_values($attrs); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | { |
| 117 | 117 | $obj = clone $this; |
| 118 | 118 | $obj->_attributes = array_filter($obj->_attributes, |
| 119 | - function (Attribute $a) use ($attr) { |
|
| 119 | + function(Attribute $a) use ($attr) { |
|
| 120 | 120 | return $a->oid() != $attr->oid(); |
| 121 | 121 | }); |
| 122 | 122 | $obj->_attributes[] = $attr; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ++$idx; |
| 64 | 64 | } |
| 65 | 65 | $values = array_map( |
| 66 | - function (UnspecifiedType $el) { |
|
| 66 | + function(UnspecifiedType $el) { |
|
| 67 | 67 | return IetfAttrValue::fromASN1($el); |
| 68 | 68 | }, |
| 69 | 69 | $seq->at($idx) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $this->_policyAuthority->toASN1()); |
| 149 | 149 | } |
| 150 | 150 | $values = array_map( |
| 151 | - function (IetfAttrValue $val) { |
|
| 151 | + function(IetfAttrValue $val) { |
|
| 152 | 152 | return $val->toASN1(); |
| 153 | 153 | }, $this->_values); |
| 154 | 154 | $elements[] = new Sequence(...$values); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | // is not in the user-initial-policy-set and is not anyPolicy, |
| 93 | 93 | // delete this node and all its children. |
| 94 | 94 | $valid_policy_node_set = array_filter($valid_policy_node_set, |
| 95 | - function (PolicyNode $node) use ($policies) { |
|
| 95 | + function(PolicyNode $node) use ($policies) { |
|
| 96 | 96 | if ($node->isAnyPolicy()) { |
| 97 | 97 | return true; |
| 98 | 98 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | }); |
| 105 | 105 | // array of valid policy OIDs |
| 106 | 106 | $valid_policy_set = array_map( |
| 107 | - function (PolicyNode $node) { |
|
| 107 | + function(PolicyNode $node) { |
|
| 108 | 108 | return $node->validPolicy(); |
| 109 | 109 | }, $valid_policy_node_set); |
| 110 | 110 | // 3. If the valid_policy_tree includes a node of depth n with |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | // for each node in a tree |
| 386 | 386 | $this->_root->walkNodes( |
| 387 | - function (PolicyNode $node) use (&$set) { |
|
| 387 | + function(PolicyNode $node) use (&$set) { |
|
| 388 | 388 | $parents = $node->parents(); |
| 389 | 389 | // node has parents |
| 390 | 390 | if (count($parents)) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $paths = $this->_resolvePathsToTarget($target, $intermediate); |
| 47 | 47 | // map paths to CertificationPath objects |
| 48 | 48 | return array_map( |
| 49 | - function ($certs) { |
|
| 49 | + function($certs) { |
|
| 50 | 50 | return new CertificationPath(...$certs); |
| 51 | 51 | }, $paths); |
| 52 | 52 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | throw new PathBuildingException("No certification paths."); |
| 112 | 112 | } |
| 113 | 113 | usort($paths, |
| 114 | - function ($a, $b) { |
|
| 114 | + function($a, $b) { |
|
| 115 | 115 | return count($a) < count($b) ? -1 : 1; |
| 116 | 116 | }); |
| 117 | 117 | return reset($paths); |
@@ -52,6 +52,7 @@ |
||
| 52 | 52 | * @param PathValidationConfig $config Validation config |
| 53 | 53 | * @param Certificate ...$certificates Certificates from the trust anchor to |
| 54 | 54 | * the end-entity certificate |
| 55 | + * @param Certificate[] $certificates |
|
| 55 | 56 | */ |
| 56 | 57 | public function __construct(Crypto $crypto, PathValidationConfig $config, |
| 57 | 58 | Certificate ...$certificates) |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | "GeneralNames must have at least one GeneralName."); |
| 50 | 50 | } |
| 51 | 51 | $names = array_map( |
| 52 | - function (UnspecifiedType $el) { |
|
| 52 | + function(UnspecifiedType $el) { |
|
| 53 | 53 | return GeneralName::fromASN1($el->asTagged()); |
| 54 | 54 | }, $seq->elements()); |
| 55 | 55 | return new self(...$names); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | public function allOf(int $tag): array |
| 108 | 108 | { |
| 109 | 109 | $names = array_filter($this->_names, |
| 110 | - function (GeneralName $name) use ($tag) { |
|
| 110 | + function(GeneralName $name) use ($tag) { |
|
| 111 | 111 | return $name->tag() == $tag; |
| 112 | 112 | }); |
| 113 | 113 | return array_values($names); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | "GeneralNames must have at least one GeneralName."); |
| 172 | 172 | } |
| 173 | 173 | $elements = array_map( |
| 174 | - function (GeneralName $name) { |
|
| 174 | + function(GeneralName $name) { |
|
| 175 | 175 | return $name->toASN1(); |
| 176 | 176 | }, $this->_names); |
| 177 | 177 | return new Sequence(...$elements); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | protected static function _wordsToIPv6String(array $words): string |
| 41 | 41 | { |
| 42 | 42 | $groups = array_map( |
| 43 | - function ($word) { |
|
| 43 | + function($word) { |
|
| 44 | 44 | return sprintf("%04x", $word); |
| 45 | 45 | }, $words); |
| 46 | 46 | return implode(":", $groups); |