@@ -37,6 +37,7 @@ |
||
37 | 37 | * Constructor |
38 | 38 | * |
39 | 39 | * @param IetfAttrValue ...$values |
40 | + * @param IetfAttrValue[] $values |
|
40 | 41 | */ |
41 | 42 | public function __construct(IetfAttrValue ...$values) { |
42 | 43 | $this->_policyAuthority = null; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | ++$idx; |
57 | 57 | } |
58 | 58 | $values = array_map( |
59 | - function (UnspecifiedType $el) { |
|
59 | + function(UnspecifiedType $el) { |
|
60 | 60 | return IetfAttrValue::fromASN1($el); |
61 | 61 | }, $seq->at($idx) |
62 | 62 | ->asSequence() |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $this->_policyAuthority->toASN1()); |
135 | 135 | } |
136 | 136 | $values = array_map( |
137 | - function (IetfAttrValue $val) { |
|
137 | + function(IetfAttrValue $val) { |
|
138 | 138 | return $val->toASN1(); |
139 | 139 | }, $this->_values); |
140 | 140 | $elements[] = new Sequence(...$values); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * Generate ASN.1 element. |
80 | 80 | * |
81 | 81 | * @throws \UnexpectedValueException |
82 | - * @return StringType |
|
82 | + * @return Element[] |
|
83 | 83 | */ |
84 | 84 | public function toASN1() { |
85 | 85 | switch ($this->_tag) { |
@@ -97,6 +97,9 @@ discard block |
||
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | + /** |
|
101 | + * @param string $str |
|
102 | + */ |
|
100 | 103 | protected static function _determineType($str) { |
101 | 104 | // @todo Support other types |
102 | 105 | return Element::TYPE_UTF8_STRING; |
@@ -28,6 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @param string $critical |
30 | 30 | * @param PolicyMapping ...$mappings One or more PolicyMapping objects |
31 | + * @param PolicyMapping[] $mappings |
|
31 | 32 | */ |
32 | 33 | public function __construct($critical, PolicyMapping ...$mappings) { |
33 | 34 | parent::__construct(self::OID_POLICY_MAPPINGS, $critical); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | protected static function _fromDER($data, $critical) { |
38 | 38 | $mappings = array_map( |
39 | - function (UnspecifiedType $el) { |
|
39 | + function(UnspecifiedType $el) { |
|
40 | 40 | return PolicyMapping::fromASN1($el->asSequence()); |
41 | 41 | }, Sequence::fromDER($data)->elements()); |
42 | 42 | if (!count($mappings)) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | throw new \LogicException("No mappings."); |
52 | 52 | } |
53 | 53 | $elements = array_map( |
54 | - function (PolicyMapping $mapping) { |
|
54 | + function(PolicyMapping $mapping) { |
|
55 | 55 | return $mapping->toASN1(); |
56 | 56 | }, $this->_mappings); |
57 | 57 | return new Sequence(...$elements); |
@@ -356,6 +356,7 @@ discard block |
||
356 | 356 | * Get self with extensions added. |
357 | 357 | * |
358 | 358 | * @param Extension ...$exts One or more Extension objects |
359 | + * @param Extension[] $exts |
|
359 | 360 | * @return self |
360 | 361 | */ |
361 | 362 | public function withAdditionalExtensions(Extension ...$exts) { |
@@ -397,7 +398,7 @@ discard block |
||
397 | 398 | /** |
398 | 399 | * Get serial number. |
399 | 400 | * |
400 | - * @return int|string Base 10 integer |
|
401 | + * @return integer Base 10 integer |
|
401 | 402 | */ |
402 | 403 | public function serialNumber() { |
403 | 404 | if (!$this->hasSerialNumber()) { |
@@ -50,6 +50,7 @@ |
||
50 | 50 | * @param Crypto $crypto |
51 | 51 | * @param PathValidationConfig $config |
52 | 52 | * @param Certificate ...$certificates |
53 | + * @param Certificate[] $certificates |
|
53 | 54 | */ |
54 | 55 | public function __construct(Crypto $crypto, PathValidationConfig $config, |
55 | 56 | Certificate ...$certificates) { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use CryptoUtil\Crypto\Crypto; |
6 | 6 | use X509\Certificate\Certificate; |
7 | -use X509\Certificate\Extension\Extension; |
|
8 | 7 | use X509\Certificate\TBSCertificate; |
9 | 8 | use X509\CertificationPath\Exception\PathValidationException; |
10 | 9 |
@@ -197,7 +197,6 @@ |
||
197 | 197 | * |
198 | 198 | * @param Crypto $crypto Crypto engine |
199 | 199 | * @param SignatureAlgorithmIdentifier $algo Algorithm used for signing |
200 | - * @param PrivateKey $private_key Private key used for signing |
|
201 | 200 | * @return CertificationRequest |
202 | 201 | */ |
203 | 202 | public function sign(Crypto $crypto, SignatureAlgorithmIdentifier $algo, |
@@ -28,6 +28,7 @@ |
||
28 | 28 | * Constructor |
29 | 29 | * |
30 | 30 | * @param GeneralName ...$names One or more GeneralName objects |
31 | + * @param GeneralName[] $names |
|
31 | 32 | */ |
32 | 33 | public function __construct(GeneralName ...$names) { |
33 | 34 | $this->_names = $names; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | "GeneralNames must have at least one GeneralName."); |
47 | 47 | } |
48 | 48 | $names = array_map( |
49 | - function (UnspecifiedType $el) { |
|
49 | + function(UnspecifiedType $el) { |
|
50 | 50 | return GeneralName::fromASN1($el->asTagged()); |
51 | 51 | }, $seq->elements()); |
52 | 52 | return new self(...$names); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function allOf($tag) { |
102 | 102 | $names = array_filter($this->_names, |
103 | - function (GeneralName $name) use ($tag) { |
|
103 | + function(GeneralName $name) use ($tag) { |
|
104 | 104 | return $name->tag() == $tag; |
105 | 105 | }); |
106 | 106 | return array_values($names); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | "GeneralNames must have at least one GeneralName."); |
145 | 145 | } |
146 | 146 | $elements = array_map( |
147 | - function (GeneralName $name) { |
|
147 | + function(GeneralName $name) { |
|
148 | 148 | return $name->toASN1(); |
149 | 149 | }, $this->_names); |
150 | 150 | return new Sequence(...$elements); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | protected static function _wordsToIPv6String(array $words) { |
34 | 34 | $groups = array_map( |
35 | - function ($word) { |
|
35 | + function($word) { |
|
36 | 36 | return sprintf("%04x", $word); |
37 | 37 | }, $words); |
38 | 38 | return implode(":", $groups); |
@@ -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); |