@@ -24,6 +24,7 @@ |
||
24 | 24 | * Constructor |
25 | 25 | * |
26 | 26 | * @param Target ...$targets |
27 | + * @param Target[] $targets |
|
27 | 28 | */ |
28 | 29 | public function __construct(Target ...$targets) { |
29 | 30 | $this->_targets = $targets; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function fromASN1(Sequence $seq) { |
39 | 39 | $targets = array_map( |
40 | - function (Element $el) { |
|
40 | + function(Element $el) { |
|
41 | 41 | return Target::fromASN1($el->expectTagged()); |
42 | 42 | }, $seq->elements()); |
43 | 43 | return new self(...$targets); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function toASN1() { |
61 | 61 | $elements = array_map( |
62 | - function (Target $target) { |
|
62 | + function(Target $target) { |
|
63 | 63 | return $target->toASN1(); |
64 | 64 | }, $this->_targets); |
65 | 65 | return new Sequence(...$elements); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * Constructor |
39 | 39 | * |
40 | 40 | * @param bool $critical |
41 | - * @param Targets ...$targets |
|
41 | + * @param Targets Targets[] |
|
42 | 42 | */ |
43 | 43 | public function __construct($critical, Targets ...$targets) { |
44 | 44 | parent::__construct(self::OID_TARGET_INFORMATION, $critical); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | protected static function _fromDER($data, $critical) { |
49 | 49 | $targets = array_map( |
50 | - function (Element $el) { |
|
50 | + function(Element $el) { |
|
51 | 51 | return Targets::fromASN1( |
52 | 52 | $el->expectType(Element::TYPE_SEQUENCE)); |
53 | 53 | }, Sequence::fromDER($data)->elements()); |
@@ -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); |
@@ -40,6 +40,7 @@ |
||
40 | 40 | * Constructor |
41 | 41 | * |
42 | 42 | * @param Extension ...$extensions Extension objects |
43 | + * @param Extension[] $extensions |
|
43 | 44 | */ |
44 | 45 | public function __construct(Extension ...$extensions) { |
45 | 46 | $this->_extensions = array(); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function fromASN1(Sequence $seq) { |
58 | 58 | $extensions = array_map( |
59 | - function (Element $el) { |
|
59 | + function(Element $el) { |
|
60 | 60 | return Extension::fromASN1( |
61 | 61 | $el->expectType(Element::TYPE_SEQUENCE)); |
62 | 62 | }, $seq->elements()); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function toASN1() { |
72 | 72 | $elements = array_values( |
73 | - array_map(function ($ext) { |
|
73 | + array_map(function($ext) { |
|
74 | 74 | return $ext->toASN1(); |
75 | 75 | }, $this->_extensions)); |
76 | 76 | 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 |
@@ -38,6 +38,7 @@ discard block |
||
38 | 38 | * Constructor |
39 | 39 | * |
40 | 40 | * @param Attribute ...$attribs Attribute objects |
41 | + * @param Attribute[] $attribs |
|
41 | 42 | */ |
42 | 43 | public function __construct(Attribute ...$attribs) { |
43 | 44 | $this->_attributes = $attribs; |
@@ -47,6 +48,7 @@ discard block |
||
47 | 48 | * Initialize from attribute values. |
48 | 49 | * |
49 | 50 | * @param AttributeValue ...$values |
51 | + * @param AttributeValue[] $values |
|
50 | 52 | * @return self |
51 | 53 | */ |
52 | 54 | public static function fromAttributeValues(AttributeValue ...$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); |
@@ -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 (Element $el) { |
|
49 | + function(Element $el) { |
|
50 | 50 | return GeneralName::fromASN1($el->expectTagged()); |
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); |