@@ -23,6 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @param bool $critical |
25 | 25 | * @param Attribute ...$attribs One or more Attribute objects |
26 | + * @param Attribute[] $attribs |
|
26 | 27 | */ |
27 | 28 | public function __construct($critical, Attribute ...$attribs) { |
28 | 29 | parent::__construct(self::OID_SUBJECT_DIRECTORY_ATTRIBUTES, $critical); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | protected static function _fromDER($data, $critical) { |
33 | 33 | $attribs = array_map( |
34 | - function (Element $el) { |
|
34 | + function(Element $el) { |
|
35 | 35 | return Attribute::fromASN1( |
36 | 36 | $el->expectType(Element::TYPE_SEQUENCE)); |
37 | 37 | }, Sequence::fromDER($data)->elements()); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | throw new \LogicException("No attributes"); |
48 | 48 | } |
49 | 49 | $elements = array_map( |
50 | - function (Attribute $attr) { |
|
50 | + function(Attribute $attr) { |
|
51 | 51 | return $attr->toASN1(); |
52 | 52 | }, array_values($this->_attributes)); |
53 | 53 | return new Sequence(...$elements); |
@@ -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) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public static function fromAttributeValues(AttributeValue ...$values) { |
53 | 53 | $attribs = array_map( |
54 | - function (AttributeValue $value) { |
|
54 | + function(AttributeValue $value) { |
|
55 | 55 | return $value->toAttribute(); |
56 | 56 | }, $values); |
57 | 57 | return new self(...$attribs); |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public static function fromASN1(Set $set) { |
67 | 67 | $attribs = array_map( |
68 | - function (Element $el) { |
|
68 | + function(Element $el) { |
|
69 | 69 | return Attribute::fromASN1( |
70 | 70 | $el->expectType(Element::TYPE_SEQUENCE)); |
71 | 71 | }, $set->elements()); |
72 | 72 | // cast attributes |
73 | 73 | $attribs = array_map( |
74 | - function (Attribute $attr) { |
|
74 | + function(Attribute $attr) { |
|
75 | 75 | $oid = $attr->oid(); |
76 | 76 | if (array_key_exists($oid, self::MAP_OID_TO_CLASS)) { |
77 | 77 | $cls = self::MAP_OID_TO_CLASS[$oid]; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function toASN1() { |
113 | 113 | $elements = array_map( |
114 | - function (Attribute $attr) { |
|
114 | + function(Attribute $attr) { |
|
115 | 115 | return $attr->toASN1(); |
116 | 116 | }, array_values($this->_attributes)); |
117 | 117 | $set = new Set(...$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); |