@@ -63,11 +63,11 @@ |
||
63 | 63 | $str = preg_replace('/^([ #])/u', '\\\\$1', $str); |
64 | 64 | // implementation specific special characters |
65 | 65 | $str = preg_replace_callback('/([\pC])/u', |
66 | - function ($m) { |
|
66 | + function($m) { |
|
67 | 67 | $octets = str_split(bin2hex($m[1]), 2); |
68 | 68 | return implode("", |
69 | 69 | array_map( |
70 | - function ($octet) { |
|
70 | + function($octet) { |
|
71 | 71 | return '\\' . strtoupper($octet); |
72 | 72 | }, $octets)); |
73 | 73 | }, $str); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public static function fromAttributeValues(AttributeValue ...$values) |
45 | 45 | { |
46 | 46 | $attribs = array_map( |
47 | - function (AttributeValue $value) { |
|
47 | + function(AttributeValue $value) { |
|
48 | 48 | return new AttributeTypeAndValue( |
49 | 49 | new AttributeType($value->oid()), $value); |
50 | 50 | }, $values); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public static function fromASN1(Set $set) |
61 | 61 | { |
62 | 62 | $attribs = array_map( |
63 | - function (UnspecifiedType $el) { |
|
63 | + function(UnspecifiedType $el) { |
|
64 | 64 | return AttributeTypeAndValue::fromASN1($el->asSequence()); |
65 | 65 | }, $set->elements()); |
66 | 66 | return new self(...$attribs); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function toASN1() |
75 | 75 | { |
76 | 76 | $elements = array_map( |
77 | - function (AttributeTypeAndValue $tv) { |
|
77 | + function(AttributeTypeAndValue $tv) { |
|
78 | 78 | return $tv->toASN1(); |
79 | 79 | }, $this->_attribs); |
80 | 80 | $set = new Set(...$elements); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function toString() |
91 | 91 | { |
92 | 92 | $parts = array_map( |
93 | - function (AttributeTypeAndValue $tv) { |
|
93 | + function(AttributeTypeAndValue $tv) { |
|
94 | 94 | return $tv->toString(); |
95 | 95 | }, $this->_attribs); |
96 | 96 | return implode("+", $parts); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | $oid = AttributeType::attrNameToOID($name); |
147 | 147 | $attribs = array_filter($this->_attribs, |
148 | - function (AttributeTypeAndValue $tv) use ($oid) { |
|
148 | + function(AttributeTypeAndValue $tv) use ($oid) { |
|
149 | 149 | return $tv->oid() == $oid; |
150 | 150 | }); |
151 | 151 | return array_values($attribs); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public static function fromASN1(Sequence $seq) |
46 | 46 | { |
47 | 47 | $rdns = array_map( |
48 | - function (UnspecifiedType $el) { |
|
48 | + function(UnspecifiedType $el) { |
|
49 | 49 | return RDN::fromASN1($el->asSet()); |
50 | 50 | }, $seq->elements()); |
51 | 51 | return new self(...$rdns); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function toASN1() |
89 | 89 | { |
90 | 90 | $elements = array_map( |
91 | - function (RDN $rdn) { |
|
91 | + function(RDN $rdn) { |
|
92 | 92 | return $rdn->toASN1(); |
93 | 93 | }, $this->_rdns); |
94 | 94 | return new Sequence(...$elements); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function toString() |
104 | 104 | { |
105 | 105 | $parts = array_map( |
106 | - function (RDN $rdn) { |
|
106 | + function(RDN $rdn) { |
|
107 | 107 | return $rdn->toString(); |
108 | 108 | }, array_reverse($this->_rdns)); |
109 | 109 | return implode(",", $parts); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $oid = AttributeType::attrNameToOID($name); |
192 | 192 | return array_sum( |
193 | 193 | array_map( |
194 | - function (RDN $rdn) use ($oid) { |
|
194 | + function(RDN $rdn) use ($oid) { |
|
195 | 195 | return count($rdn->allOf($oid)); |
196 | 196 | }, $this->_rdns)); |
197 | 197 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | // check that attribute values have correct oid |
37 | 37 | array_walk($values, |
38 | - function (AttributeValue $value) use ($type) { |
|
38 | + function(AttributeValue $value) use ($type) { |
|
39 | 39 | if ($value->oid() != $type->oid()) { |
40 | 40 | throw new \LogicException("Attribute OID mismatch."); |
41 | 41 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $type = AttributeType::fromASN1($seq->at(0)->asObjectIdentifier()); |
56 | 56 | $values = array_map( |
57 | - function (UnspecifiedType $el) use ($type) { |
|
57 | + function(UnspecifiedType $el) use ($type) { |
|
58 | 58 | return AttributeValue::fromASN1ByOID($type->oid(), $el); |
59 | 59 | }, $seq->at(1) |
60 | 60 | ->asSet() |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function toASN1() |
112 | 112 | { |
113 | 113 | $values = array_map( |
114 | - function (AttributeValue $value) { |
|
114 | + function(AttributeValue $value) { |
|
115 | 115 | return $value->toASN1(); |
116 | 116 | }, $this->_values); |
117 | 117 | $valueset = new Set(...$values); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | $oid = $this->oid(); |
142 | 142 | $values = array_map( |
143 | - function (AttributeValue $value) use ($cls, $oid) { |
|
143 | + function(AttributeValue $value) use ($cls, $oid) { |
|
144 | 144 | $value = $cls::fromSelf($value); |
145 | 145 | if ($value->oid() != $oid) { |
146 | 146 | throw new \LogicException("Attribute OID mismatch."); |