@@ -62,11 +62,11 @@ |
||
| 62 | 62 | $str = preg_replace('/^([ #])/u', '\\\\$1', $str); |
| 63 | 63 | // implementation specific special characters |
| 64 | 64 | $str = preg_replace_callback('/([\pC])/u', |
| 65 | - function ($m) { |
|
| 65 | + function($m) { |
|
| 66 | 66 | $octets = str_split(bin2hex($m[1]), 2); |
| 67 | 67 | return implode("", |
| 68 | 68 | array_map( |
| 69 | - function ($octet) { |
|
| 69 | + function($octet) { |
|
| 70 | 70 | return '\\' . strtoupper($octet); |
| 71 | 71 | }, $octets)); |
| 72 | 72 | }, $str); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function __construct(AttributeType $type, AttributeValue ...$values) { |
| 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 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public static function fromASN1(Sequence $seq) { |
| 54 | 54 | $type = AttributeType::fromASN1($seq->at(0)->asObjectIdentifier()); |
| 55 | 55 | $values = array_map( |
| 56 | - function (UnspecifiedType $el) use ($type) { |
|
| 56 | + function(UnspecifiedType $el) use ($type) { |
|
| 57 | 57 | return AttributeValue::fromASN1ByOID($type->oid(), $el); |
| 58 | 58 | }, $seq->at(1) |
| 59 | 59 | ->asSet() |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function toASN1() { |
| 108 | 108 | $values = array_map( |
| 109 | - function (AttributeValue $value) { |
|
| 109 | + function(AttributeValue $value) { |
|
| 110 | 110 | return $value->toASN1(); |
| 111 | 111 | }, $this->_values); |
| 112 | 112 | $valueset = new Set(...$values); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | $oid = $this->oid(); |
| 136 | 136 | $values = array_map( |
| 137 | - function (AttributeValue $value) use ($cls, $oid) { |
|
| 137 | + function(AttributeValue $value) use ($cls, $oid) { |
|
| 138 | 138 | $value = $cls::fromSelf($value); |
| 139 | 139 | if ($value->oid() != $oid) { |
| 140 | 140 | throw new \LogicException("Attribute OID mismatch."); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public static function fromASN1(Sequence $seq) { |
| 46 | 46 | $rdns = array_map( |
| 47 | - function (UnspecifiedType $el) { |
|
| 47 | + function(UnspecifiedType $el) { |
|
| 48 | 48 | return RDN::fromASN1($el->asSet()); |
| 49 | 49 | }, $seq->elements()); |
| 50 | 50 | return new self(...$rdns); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function toASN1() { |
| 86 | 86 | $elements = array_map( |
| 87 | - function (RDN $rdn) { |
|
| 87 | + function(RDN $rdn) { |
|
| 88 | 88 | return $rdn->toASN1(); |
| 89 | 89 | }, $this->_rdns); |
| 90 | 90 | return new Sequence(...$elements); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function toString() { |
| 100 | 100 | $parts = array_map( |
| 101 | - function (RDN $rdn) { |
|
| 101 | + function(RDN $rdn) { |
|
| 102 | 102 | return $rdn->toString(); |
| 103 | 103 | }, array_reverse($this->_rdns)); |
| 104 | 104 | return implode(",", $parts); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public static function fromAttributeValues(AttributeValue ...$values) { |
| 45 | 45 | $attribs = array_map( |
| 46 | - function (AttributeValue $value) { |
|
| 46 | + function(AttributeValue $value) { |
|
| 47 | 47 | return new AttributeTypeAndValue( |
| 48 | 48 | new AttributeType($value->oid()), $value); |
| 49 | 49 | }, $values); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public static function fromASN1(Set $set) { |
| 60 | 60 | $attribs = array_map( |
| 61 | - function (UnspecifiedType $el) { |
|
| 61 | + function(UnspecifiedType $el) { |
|
| 62 | 62 | return AttributeTypeAndValue::fromASN1($el->asSequence()); |
| 63 | 63 | }, $set->elements()); |
| 64 | 64 | return new self(...$attribs); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function toASN1() { |
| 73 | 73 | $elements = array_map( |
| 74 | - function (AttributeTypeAndValue $tv) { |
|
| 74 | + function(AttributeTypeAndValue $tv) { |
|
| 75 | 75 | return $tv->toASN1(); |
| 76 | 76 | }, $this->_attribs); |
| 77 | 77 | $set = new Set(...$elements); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function toString() { |
| 88 | 88 | $parts = array_map( |
| 89 | - function (AttributeTypeAndValue $tv) { |
|
| 89 | + function(AttributeTypeAndValue $tv) { |
|
| 90 | 90 | return $tv->toString(); |
| 91 | 91 | }, $this->_attribs); |
| 92 | 92 | return implode("+", $parts); |