@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public static function fromPEMs(PEM ...$pems) { |
38 | 38 | $certs = array_map( |
39 | - function (PEM $pem) { |
|
39 | + function(PEM $pem) { |
|
40 | 40 | return Certificate::fromPEM($pem); |
41 | 41 | }, $pems); |
42 | 42 | return new self(...$certs); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function toPEMString() { |
107 | 107 | return implode("\n", |
108 | 108 | array_map( |
109 | - function (Certificate $cert) { |
|
109 | + function(Certificate $cert) { |
|
110 | 110 | return $cert->toPEM()->string(); |
111 | 111 | }, $this->_certs)); |
112 | 112 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * Calculate policy intersection as specified in Wrap-Up Procedure 6.1.5.g. |
81 | 81 | * |
82 | 82 | * @param ValidatorState $state |
83 | - * @param array $policies |
|
83 | + * @param string[] $policies |
|
84 | 84 | * @return ValidatorState |
85 | 85 | */ |
86 | 86 | public function calculateIntersection(ValidatorState $state, array $policies) { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | * @param Certificate $cert |
261 | 261 | * @param ValidatorState $state |
262 | 262 | * @param string $idp OID of the issuer domain policy |
263 | - * @param array $sdps Array of subject domain policy OIDs |
|
263 | + * @param string[] $sdps Array of subject domain policy OIDs |
|
264 | 264 | */ |
265 | 265 | protected function _applyAnyPolicyMapping(Certificate $cert, |
266 | 266 | ValidatorState $state, $idp, array $sdps) { |
@@ -392,6 +392,7 @@ discard block |
||
392 | 392 | * Gather all children of given nodes to a flattened array. |
393 | 393 | * |
394 | 394 | * @param PolicyNode ...$nodes |
395 | + * @param PolicyNode[] $nodes |
|
395 | 396 | * @return PolicyNode[] |
396 | 397 | */ |
397 | 398 | private static function _gatherChildren(PolicyNode ...$nodes) { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use X509\Certificate\Certificate; |
6 | 6 | use X509\Certificate\Extension\CertificatePolicy\PolicyInformation; |
7 | -use X509\Certificate\Extension\PolicyMappings\PolicyMapping; |
|
8 | 7 | use X509\CertificationPath\PathValidation\ValidatorState; |
9 | 8 | |
10 | 9 |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // is not in the user-initial-policy-set and is not anyPolicy, |
91 | 91 | // delete this node and all its children. |
92 | 92 | $valid_policy_node_set = array_filter($valid_policy_node_set, |
93 | - function (PolicyNode $node) use ($policies) { |
|
93 | + function(PolicyNode $node) use ($policies) { |
|
94 | 94 | if ($node->isAnyPolicy()) { |
95 | 95 | return true; |
96 | 96 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | }); |
103 | 103 | // array of valid policy OIDs |
104 | 104 | $valid_policy_set = array_map( |
105 | - function (PolicyNode $node) { |
|
105 | + function(PolicyNode $node) { |
|
106 | 106 | return $node->validPolicy(); |
107 | 107 | }, $valid_policy_node_set); |
108 | 108 | // 3. If the valid_policy_tree includes a node of depth n with |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | } |
373 | 373 | // for each node in a tree |
374 | 374 | $this->_root->walkNodes( |
375 | - function (PolicyNode $node) use (&$set) { |
|
375 | + function(PolicyNode $node) use (&$set) { |
|
376 | 376 | $parents = $node->parents(); |
377 | 377 | // node has parents |
378 | 378 | if (count($parents)) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | protected static function _fromDER($data, $critical) { |
39 | 39 | $mappings = array_map( |
40 | - function (UnspecifiedType $el) { |
|
40 | + function(UnspecifiedType $el) { |
|
41 | 41 | return PolicyMapping::fromASN1($el->asSequence()); |
42 | 42 | }, Sequence::fromDER($data)->elements()); |
43 | 43 | if (!count($mappings)) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | throw new \LogicException("No mappings."); |
53 | 53 | } |
54 | 54 | $elements = array_map( |
55 | - function (PolicyMapping $mapping) { |
|
55 | + function(PolicyMapping $mapping) { |
|
56 | 56 | return $mapping->toASN1(); |
57 | 57 | }, $this->_mappings); |
58 | 58 | return new Sequence(...$elements); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function issuerDomainPolicies() { |
115 | 115 | $idps = array_map( |
116 | - function (PolicyMapping $mapping) { |
|
116 | + function(PolicyMapping $mapping) { |
|
117 | 117 | return $mapping->issuerDomainPolicy(); |
118 | 118 | }, $this->_mappings); |
119 | 119 | return array_values(array_unique($idps)); |