GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch php72 (a7f01e)
by Joni
04:53
created
lib/X509/AttributeCertificate/AttCertIssuer.php 3 patches
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -18,72 +18,72 @@
 block discarded – undo
18 18
  */
19 19
 abstract class AttCertIssuer
20 20
 {
21
-    /**
22
-     * Generate ASN.1 element.
23
-     *
24
-     * @return Element
25
-     */
26
-    abstract public function toASN1(): Element;
21
+	/**
22
+	 * Generate ASN.1 element.
23
+	 *
24
+	 * @return Element
25
+	 */
26
+	abstract public function toASN1(): Element;
27 27
 
28
-    /**
29
-     * Check whether AttCertIssuer identifies given certificate.
30
-     *
31
-     * @param Certificate $cert
32
-     *
33
-     * @return bool
34
-     */
35
-    abstract public function identifiesPKC(Certificate $cert): bool;
28
+	/**
29
+	 * Check whether AttCertIssuer identifies given certificate.
30
+	 *
31
+	 * @param Certificate $cert
32
+	 *
33
+	 * @return bool
34
+	 */
35
+	abstract public function identifiesPKC(Certificate $cert): bool;
36 36
 
37
-    /**
38
-     * Initialize from distinguished name.
39
-     *
40
-     * This conforms to RFC 5755 which states that only v2Form must be used,
41
-     * and issuerName must contain exactly one GeneralName of DirectoryName
42
-     * type.
43
-     *
44
-     * @see https://tools.ietf.org/html/rfc5755#section-4.2.3
45
-     *
46
-     * @param Name $name
47
-     *
48
-     * @return self
49
-     */
50
-    public static function fromName(Name $name): self
51
-    {
52
-        return new V2Form(new GeneralNames(new DirectoryName($name)));
53
-    }
37
+	/**
38
+	 * Initialize from distinguished name.
39
+	 *
40
+	 * This conforms to RFC 5755 which states that only v2Form must be used,
41
+	 * and issuerName must contain exactly one GeneralName of DirectoryName
42
+	 * type.
43
+	 *
44
+	 * @see https://tools.ietf.org/html/rfc5755#section-4.2.3
45
+	 *
46
+	 * @param Name $name
47
+	 *
48
+	 * @return self
49
+	 */
50
+	public static function fromName(Name $name): self
51
+	{
52
+		return new V2Form(new GeneralNames(new DirectoryName($name)));
53
+	}
54 54
 
55
-    /**
56
-     * Initialize from an issuer's public key certificate.
57
-     *
58
-     * @param Certificate $cert
59
-     *
60
-     * @return self
61
-     */
62
-    public static function fromPKC(Certificate $cert): self
63
-    {
64
-        return self::fromName($cert->tbsCertificate()->subject());
65
-    }
55
+	/**
56
+	 * Initialize from an issuer's public key certificate.
57
+	 *
58
+	 * @param Certificate $cert
59
+	 *
60
+	 * @return self
61
+	 */
62
+	public static function fromPKC(Certificate $cert): self
63
+	{
64
+		return self::fromName($cert->tbsCertificate()->subject());
65
+	}
66 66
 
67
-    /**
68
-     * Initialize from ASN.1.
69
-     *
70
-     * @param UnspecifiedType $el CHOICE
71
-     *
72
-     * @throws \UnexpectedValueException
73
-     *
74
-     * @return self
75
-     */
76
-    public static function fromASN1(UnspecifiedType $el): self
77
-    {
78
-        if (!$el->isTagged()) {
79
-            throw new \UnexpectedValueException('v1Form issuer not supported.');
80
-        }
81
-        $tagged = $el->asTagged();
82
-        switch ($tagged->tag()) {
83
-            case 0:
84
-                return V2Form::fromV2ASN1(
85
-                    $tagged->asImplicit(Element::TYPE_SEQUENCE)->asSequence());
86
-        }
87
-        throw new \UnexpectedValueException('Unsupported issuer type.');
88
-    }
67
+	/**
68
+	 * Initialize from ASN.1.
69
+	 *
70
+	 * @param UnspecifiedType $el CHOICE
71
+	 *
72
+	 * @throws \UnexpectedValueException
73
+	 *
74
+	 * @return self
75
+	 */
76
+	public static function fromASN1(UnspecifiedType $el): self
77
+	{
78
+		if (!$el->isTagged()) {
79
+			throw new \UnexpectedValueException('v1Form issuer not supported.');
80
+		}
81
+		$tagged = $el->asTagged();
82
+		switch ($tagged->tag()) {
83
+			case 0:
84
+				return V2Form::fromV2ASN1(
85
+					$tagged->asImplicit(Element::TYPE_SEQUENCE)->asSequence());
86
+		}
87
+		throw new \UnexpectedValueException('Unsupported issuer type.');
88
+	}
89 89
 }
Please login to merge, or discard this patch.
Switch Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,9 +80,9 @@
 block discarded – undo
80 80
         }
81 81
         $tagged = $el->asTagged();
82 82
         switch ($tagged->tag()) {
83
-            case 0:
84
-                return V2Form::fromV2ASN1(
85
-                    $tagged->asImplicit(Element::TYPE_SEQUENCE)->asSequence());
83
+        case 0:
84
+            return V2Form::fromV2ASN1(
85
+                $tagged->asImplicit(Element::TYPE_SEQUENCE)->asSequence());
86 86
         }
87 87
         throw new \UnexpectedValueException('Unsupported issuer type.');
88 88
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate;
6 6
 
Please login to merge, or discard this patch.
lib/X509/AttributeCertificate/Attribute/AccessIdentityAttributeValue.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,17 +13,17 @@
 block discarded – undo
13 13
  */
14 14
 class AccessIdentityAttributeValue extends SvceAuthInfo
15 15
 {
16
-    const OID = '1.3.6.1.5.5.7.10.2';
16
+	const OID = '1.3.6.1.5.5.7.10.2';
17 17
 
18
-    /**
19
-     * Constructor.
20
-     *
21
-     * @param GeneralName $service
22
-     * @param GeneralName $ident
23
-     */
24
-    public function __construct(GeneralName $service, GeneralName $ident)
25
-    {
26
-        parent::__construct($service, $ident, null);
27
-        $this->_oid = self::OID;
28
-    }
18
+	/**
19
+	 * Constructor.
20
+	 *
21
+	 * @param GeneralName $service
22
+	 * @param GeneralName $ident
23
+	 */
24
+	public function __construct(GeneralName $service, GeneralName $ident)
25
+	{
26
+		parent::__construct($service, $ident, null);
27
+		$this->_oid = self::OID;
28
+	}
29 29
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
Please login to merge, or discard this patch.
lib/X509/AttributeCertificate/Attribute/SvceAuthInfo.php 2 patches
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -21,145 +21,145 @@
 block discarded – undo
21 21
  */
22 22
 abstract class SvceAuthInfo extends AttributeValue
23 23
 {
24
-    /**
25
-     * Service.
26
-     *
27
-     * @var GeneralName
28
-     */
29
-    protected $_service;
30
-
31
-    /**
32
-     * Ident.
33
-     *
34
-     * @var GeneralName
35
-     */
36
-    protected $_ident;
37
-
38
-    /**
39
-     * Auth info.
40
-     *
41
-     * @var null|string
42
-     */
43
-    protected $_authInfo;
44
-
45
-    /**
46
-     * Constructor.
47
-     *
48
-     * @param GeneralName $service
49
-     * @param GeneralName $ident
50
-     * @param null|string $auth_info
51
-     */
52
-    public function __construct(GeneralName $service, GeneralName $ident,
53
-        ?string $auth_info = null)
54
-    {
55
-        $this->_service = $service;
56
-        $this->_ident = $ident;
57
-        $this->_authInfo = $auth_info;
58
-    }
59
-
60
-    /**
61
-     * {@inheritdoc}
62
-     *
63
-     * @return self
64
-     */
65
-    public static function fromASN1(UnspecifiedType $el): AttributeValue
66
-    {
67
-        $seq = $el->asSequence();
68
-        $service = GeneralName::fromASN1($seq->at(0)->asTagged());
69
-        $ident = GeneralName::fromASN1($seq->at(1)->asTagged());
70
-        $auth_info = null;
71
-        if ($seq->has(2, Element::TYPE_OCTET_STRING)) {
72
-            $auth_info = $seq->at(2)->asString()->string();
73
-        }
74
-        return new static($service, $ident, $auth_info);
75
-    }
76
-
77
-    /**
78
-     * Get service name.
79
-     *
80
-     * @return GeneralName
81
-     */
82
-    public function service(): GeneralName
83
-    {
84
-        return $this->_service;
85
-    }
86
-
87
-    /**
88
-     * Get ident.
89
-     *
90
-     * @return GeneralName
91
-     */
92
-    public function ident(): GeneralName
93
-    {
94
-        return $this->_ident;
95
-    }
96
-
97
-    /**
98
-     * Check whether authentication info is present.
99
-     *
100
-     * @return bool
101
-     */
102
-    public function hasAuthInfo(): bool
103
-    {
104
-        return isset($this->_authInfo);
105
-    }
106
-
107
-    /**
108
-     * Get authentication info.
109
-     *
110
-     * @throws \LogicException If not set
111
-     *
112
-     * @return string
113
-     */
114
-    public function authInfo(): string
115
-    {
116
-        if (!$this->hasAuthInfo()) {
117
-            throw new \LogicException('authInfo not set.');
118
-        }
119
-        return $this->_authInfo;
120
-    }
121
-
122
-    /**
123
-     * {@inheritdoc}
124
-     */
125
-    public function toASN1(): Element
126
-    {
127
-        $elements = [$this->_service->toASN1(), $this->_ident->toASN1()];
128
-        if (isset($this->_authInfo)) {
129
-            $elements[] = new OctetString($this->_authInfo);
130
-        }
131
-        return new Sequence(...$elements);
132
-    }
133
-
134
-    /**
135
-     * {@inheritdoc}
136
-     */
137
-    public function stringValue(): string
138
-    {
139
-        return '#' . bin2hex($this->toASN1()->toDER());
140
-    }
141
-
142
-    /**
143
-     * {@inheritdoc}
144
-     */
145
-    public function equalityMatchingRule(): MatchingRule
146
-    {
147
-        return new BinaryMatch();
148
-    }
149
-
150
-    /**
151
-     * {@inheritdoc}
152
-     */
153
-    public function rfc2253String(): string
154
-    {
155
-        return $this->stringValue();
156
-    }
157
-
158
-    /**
159
-     * {@inheritdoc}
160
-     */
161
-    protected function _transcodedString(): string
162
-    {
163
-        return $this->stringValue();
164
-    }
24
+	/**
25
+	 * Service.
26
+	 *
27
+	 * @var GeneralName
28
+	 */
29
+	protected $_service;
30
+
31
+	/**
32
+	 * Ident.
33
+	 *
34
+	 * @var GeneralName
35
+	 */
36
+	protected $_ident;
37
+
38
+	/**
39
+	 * Auth info.
40
+	 *
41
+	 * @var null|string
42
+	 */
43
+	protected $_authInfo;
44
+
45
+	/**
46
+	 * Constructor.
47
+	 *
48
+	 * @param GeneralName $service
49
+	 * @param GeneralName $ident
50
+	 * @param null|string $auth_info
51
+	 */
52
+	public function __construct(GeneralName $service, GeneralName $ident,
53
+		?string $auth_info = null)
54
+	{
55
+		$this->_service = $service;
56
+		$this->_ident = $ident;
57
+		$this->_authInfo = $auth_info;
58
+	}
59
+
60
+	/**
61
+	 * {@inheritdoc}
62
+	 *
63
+	 * @return self
64
+	 */
65
+	public static function fromASN1(UnspecifiedType $el): AttributeValue
66
+	{
67
+		$seq = $el->asSequence();
68
+		$service = GeneralName::fromASN1($seq->at(0)->asTagged());
69
+		$ident = GeneralName::fromASN1($seq->at(1)->asTagged());
70
+		$auth_info = null;
71
+		if ($seq->has(2, Element::TYPE_OCTET_STRING)) {
72
+			$auth_info = $seq->at(2)->asString()->string();
73
+		}
74
+		return new static($service, $ident, $auth_info);
75
+	}
76
+
77
+	/**
78
+	 * Get service name.
79
+	 *
80
+	 * @return GeneralName
81
+	 */
82
+	public function service(): GeneralName
83
+	{
84
+		return $this->_service;
85
+	}
86
+
87
+	/**
88
+	 * Get ident.
89
+	 *
90
+	 * @return GeneralName
91
+	 */
92
+	public function ident(): GeneralName
93
+	{
94
+		return $this->_ident;
95
+	}
96
+
97
+	/**
98
+	 * Check whether authentication info is present.
99
+	 *
100
+	 * @return bool
101
+	 */
102
+	public function hasAuthInfo(): bool
103
+	{
104
+		return isset($this->_authInfo);
105
+	}
106
+
107
+	/**
108
+	 * Get authentication info.
109
+	 *
110
+	 * @throws \LogicException If not set
111
+	 *
112
+	 * @return string
113
+	 */
114
+	public function authInfo(): string
115
+	{
116
+		if (!$this->hasAuthInfo()) {
117
+			throw new \LogicException('authInfo not set.');
118
+		}
119
+		return $this->_authInfo;
120
+	}
121
+
122
+	/**
123
+	 * {@inheritdoc}
124
+	 */
125
+	public function toASN1(): Element
126
+	{
127
+		$elements = [$this->_service->toASN1(), $this->_ident->toASN1()];
128
+		if (isset($this->_authInfo)) {
129
+			$elements[] = new OctetString($this->_authInfo);
130
+		}
131
+		return new Sequence(...$elements);
132
+	}
133
+
134
+	/**
135
+	 * {@inheritdoc}
136
+	 */
137
+	public function stringValue(): string
138
+	{
139
+		return '#' . bin2hex($this->toASN1()->toDER());
140
+	}
141
+
142
+	/**
143
+	 * {@inheritdoc}
144
+	 */
145
+	public function equalityMatchingRule(): MatchingRule
146
+	{
147
+		return new BinaryMatch();
148
+	}
149
+
150
+	/**
151
+	 * {@inheritdoc}
152
+	 */
153
+	public function rfc2253String(): string
154
+	{
155
+		return $this->stringValue();
156
+	}
157
+
158
+	/**
159
+	 * {@inheritdoc}
160
+	 */
161
+	protected function _transcodedString(): string
162
+	{
163
+		return $this->stringValue();
164
+	}
165 165
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
Please login to merge, or discard this patch.
lib/X509/AttributeCertificate/Attribute/RoleAttributeValue.php 2 patches
Indentation   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -24,146 +24,146 @@
 block discarded – undo
24 24
  */
25 25
 class RoleAttributeValue extends AttributeValue
26 26
 {
27
-    /**
28
-     * Issuing authority.
29
-     *
30
-     * @var null|GeneralNames
31
-     */
32
-    protected $_roleAuthority;
33
-
34
-    /**
35
-     * Role name.
36
-     *
37
-     * @var GeneralName
38
-     */
39
-    protected $_roleName;
40
-
41
-    /**
42
-     * Constructor.
43
-     *
44
-     * @param GeneralName       $name      Role name
45
-     * @param null|GeneralNames $authority Issuing authority
46
-     */
47
-    public function __construct(GeneralName $name,
48
-        ?GeneralNames $authority = null)
49
-    {
50
-        $this->_roleAuthority = $authority;
51
-        $this->_roleName = $name;
52
-        $this->_oid = AttributeType::OID_ROLE;
53
-    }
54
-
55
-    /**
56
-     * Initialize from a role string.
57
-     *
58
-     * @param string            $role_name Role name in URI format
59
-     * @param null|GeneralNames $authority Issuing authority
60
-     *
61
-     * @return self
62
-     */
63
-    public static function fromString(string $role_name,
64
-        ?GeneralNames $authority = null): self
65
-    {
66
-        return new self(new UniformResourceIdentifier($role_name), $authority);
67
-    }
68
-
69
-    /**
70
-     * {@inheritdoc}
71
-     *
72
-     * @return self
73
-     */
74
-    public static function fromASN1(UnspecifiedType $el): AttributeValue
75
-    {
76
-        $seq = $el->asSequence();
77
-        $authority = null;
78
-        if ($seq->hasTagged(0)) {
79
-            $authority = GeneralNames::fromASN1(
80
-                $seq->getTagged(0)->asImplicit(Element::TYPE_SEQUENCE)
81
-                    ->asSequence());
82
-        }
83
-        $name = GeneralName::fromASN1($seq->getTagged(1)
84
-            ->asExplicit()->asTagged());
85
-        return new self($name, $authority);
86
-    }
87
-
88
-    /**
89
-     * Check whether issuing authority is present.
90
-     *
91
-     * @return bool
92
-     */
93
-    public function hasRoleAuthority(): bool
94
-    {
95
-        return isset($this->_roleAuthority);
96
-    }
97
-
98
-    /**
99
-     * Get issuing authority.
100
-     *
101
-     * @throws \LogicException If not set
102
-     *
103
-     * @return GeneralNames
104
-     */
105
-    public function roleAuthority(): GeneralNames
106
-    {
107
-        if (!$this->hasRoleAuthority()) {
108
-            throw new \LogicException('roleAuthority not set.');
109
-        }
110
-        return $this->_roleAuthority;
111
-    }
112
-
113
-    /**
114
-     * Get role name.
115
-     *
116
-     * @return GeneralName
117
-     */
118
-    public function roleName(): GeneralName
119
-    {
120
-        return $this->_roleName;
121
-    }
122
-
123
-    /**
124
-     * {@inheritdoc}
125
-     */
126
-    public function toASN1(): Element
127
-    {
128
-        $elements = [];
129
-        if (isset($this->_roleAuthority)) {
130
-            $elements[] = new ImplicitlyTaggedType(
131
-                0, $this->_roleAuthority->toASN1());
132
-        }
133
-        $elements[] = new ExplicitlyTaggedType(
134
-            1, $this->_roleName->toASN1());
135
-        return new Sequence(...$elements);
136
-    }
137
-
138
-    /**
139
-     * {@inheritdoc}
140
-     */
141
-    public function stringValue(): string
142
-    {
143
-        return '#' . bin2hex($this->toASN1()->toDER());
144
-    }
145
-
146
-    /**
147
-     * {@inheritdoc}
148
-     */
149
-    public function equalityMatchingRule(): MatchingRule
150
-    {
151
-        return new BinaryMatch();
152
-    }
153
-
154
-    /**
155
-     * {@inheritdoc}
156
-     */
157
-    public function rfc2253String(): string
158
-    {
159
-        return $this->stringValue();
160
-    }
161
-
162
-    /**
163
-     * {@inheritdoc}
164
-     */
165
-    protected function _transcodedString(): string
166
-    {
167
-        return $this->stringValue();
168
-    }
27
+	/**
28
+	 * Issuing authority.
29
+	 *
30
+	 * @var null|GeneralNames
31
+	 */
32
+	protected $_roleAuthority;
33
+
34
+	/**
35
+	 * Role name.
36
+	 *
37
+	 * @var GeneralName
38
+	 */
39
+	protected $_roleName;
40
+
41
+	/**
42
+	 * Constructor.
43
+	 *
44
+	 * @param GeneralName       $name      Role name
45
+	 * @param null|GeneralNames $authority Issuing authority
46
+	 */
47
+	public function __construct(GeneralName $name,
48
+		?GeneralNames $authority = null)
49
+	{
50
+		$this->_roleAuthority = $authority;
51
+		$this->_roleName = $name;
52
+		$this->_oid = AttributeType::OID_ROLE;
53
+	}
54
+
55
+	/**
56
+	 * Initialize from a role string.
57
+	 *
58
+	 * @param string            $role_name Role name in URI format
59
+	 * @param null|GeneralNames $authority Issuing authority
60
+	 *
61
+	 * @return self
62
+	 */
63
+	public static function fromString(string $role_name,
64
+		?GeneralNames $authority = null): self
65
+	{
66
+		return new self(new UniformResourceIdentifier($role_name), $authority);
67
+	}
68
+
69
+	/**
70
+	 * {@inheritdoc}
71
+	 *
72
+	 * @return self
73
+	 */
74
+	public static function fromASN1(UnspecifiedType $el): AttributeValue
75
+	{
76
+		$seq = $el->asSequence();
77
+		$authority = null;
78
+		if ($seq->hasTagged(0)) {
79
+			$authority = GeneralNames::fromASN1(
80
+				$seq->getTagged(0)->asImplicit(Element::TYPE_SEQUENCE)
81
+					->asSequence());
82
+		}
83
+		$name = GeneralName::fromASN1($seq->getTagged(1)
84
+			->asExplicit()->asTagged());
85
+		return new self($name, $authority);
86
+	}
87
+
88
+	/**
89
+	 * Check whether issuing authority is present.
90
+	 *
91
+	 * @return bool
92
+	 */
93
+	public function hasRoleAuthority(): bool
94
+	{
95
+		return isset($this->_roleAuthority);
96
+	}
97
+
98
+	/**
99
+	 * Get issuing authority.
100
+	 *
101
+	 * @throws \LogicException If not set
102
+	 *
103
+	 * @return GeneralNames
104
+	 */
105
+	public function roleAuthority(): GeneralNames
106
+	{
107
+		if (!$this->hasRoleAuthority()) {
108
+			throw new \LogicException('roleAuthority not set.');
109
+		}
110
+		return $this->_roleAuthority;
111
+	}
112
+
113
+	/**
114
+	 * Get role name.
115
+	 *
116
+	 * @return GeneralName
117
+	 */
118
+	public function roleName(): GeneralName
119
+	{
120
+		return $this->_roleName;
121
+	}
122
+
123
+	/**
124
+	 * {@inheritdoc}
125
+	 */
126
+	public function toASN1(): Element
127
+	{
128
+		$elements = [];
129
+		if (isset($this->_roleAuthority)) {
130
+			$elements[] = new ImplicitlyTaggedType(
131
+				0, $this->_roleAuthority->toASN1());
132
+		}
133
+		$elements[] = new ExplicitlyTaggedType(
134
+			1, $this->_roleName->toASN1());
135
+		return new Sequence(...$elements);
136
+	}
137
+
138
+	/**
139
+	 * {@inheritdoc}
140
+	 */
141
+	public function stringValue(): string
142
+	{
143
+		return '#' . bin2hex($this->toASN1()->toDER());
144
+	}
145
+
146
+	/**
147
+	 * {@inheritdoc}
148
+	 */
149
+	public function equalityMatchingRule(): MatchingRule
150
+	{
151
+		return new BinaryMatch();
152
+	}
153
+
154
+	/**
155
+	 * {@inheritdoc}
156
+	 */
157
+	public function rfc2253String(): string
158
+	{
159
+		return $this->stringValue();
160
+	}
161
+
162
+	/**
163
+	 * {@inheritdoc}
164
+	 */
165
+	protected function _transcodedString(): string
166
+	{
167
+		return $this->stringValue();
168
+	}
169 169
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
Please login to merge, or discard this patch.
lib/X509/AttributeCertificate/Attribute/GroupAttributeValue.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@
 block discarded – undo
11 11
  */
12 12
 class GroupAttributeValue extends IetfAttrSyntax
13 13
 {
14
-    const OID = '1.3.6.1.5.5.7.10.4';
14
+	const OID = '1.3.6.1.5.5.7.10.4';
15 15
 
16
-    /**
17
-     * Constructor.
18
-     *
19
-     * @param IetfAttrValue ...$values
20
-     */
21
-    public function __construct(IetfAttrValue ...$values)
22
-    {
23
-        parent::__construct(...$values);
24
-        $this->_oid = self::OID;
25
-    }
16
+	/**
17
+	 * Constructor.
18
+	 *
19
+	 * @param IetfAttrValue ...$values
20
+	 */
21
+	public function __construct(IetfAttrValue ...$values)
22
+	{
23
+		parent::__construct(...$values);
24
+		$this->_oid = self::OID;
25
+	}
26 26
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
Please login to merge, or discard this patch.
lib/X509/AttributeCertificate/Attribute/IetfAttrValue.php 3 patches
Indentation   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -17,166 +17,166 @@
 block discarded – undo
17 17
  */
18 18
 class IetfAttrValue
19 19
 {
20
-    /**
21
-     * Element type tag.
22
-     *
23
-     * @var int
24
-     */
25
-    protected $_type;
26
-
27
-    /**
28
-     * Value.
29
-     *
30
-     * @var string
31
-     */
32
-    protected $_value;
33
-
34
-    /**
35
-     * Constructor.
36
-     *
37
-     * @param string $value
38
-     * @param int    $type
39
-     */
40
-    public function __construct(string $value, int $type)
41
-    {
42
-        $this->_type = $type;
43
-        $this->_value = $value;
44
-    }
45
-
46
-    /**
47
-     * @return string
48
-     */
49
-    public function __toString(): string
50
-    {
51
-        return $this->_value;
52
-    }
53
-
54
-    /**
55
-     * Initialize from ASN.1.
56
-     *
57
-     * @param UnspecifiedType $el
58
-     *
59
-     * @throws \UnexpectedValueException
60
-     *
61
-     * @return self
62
-     */
63
-    public static function fromASN1(UnspecifiedType $el): self
64
-    {
65
-        switch ($el->tag()) {
66
-            case Element::TYPE_OCTET_STRING:
67
-            case Element::TYPE_UTF8_STRING:
68
-                return new self($el->asString()->string(), $el->tag());
69
-            case Element::TYPE_OBJECT_IDENTIFIER:
70
-                return new self($el->asObjectIdentifier()->oid(), $el->tag());
71
-        }
72
-        throw new \UnexpectedValueException(
73
-            'Type ' . Element::tagToName($el->tag()) . ' not supported.');
74
-    }
75
-
76
-    /**
77
-     * Initialize from octet string.
78
-     *
79
-     * @param string $octets
80
-     *
81
-     * @return self
82
-     */
83
-    public static function fromOctets(string $octets): self
84
-    {
85
-        return new self($octets, Element::TYPE_OCTET_STRING);
86
-    }
87
-
88
-    /**
89
-     * Initialize from UTF-8 string.
90
-     *
91
-     * @param string $str
92
-     *
93
-     * @return self
94
-     */
95
-    public static function fromString(string $str): self
96
-    {
97
-        return new self($str, Element::TYPE_UTF8_STRING);
98
-    }
99
-
100
-    /**
101
-     * Initialize from OID.
102
-     *
103
-     * @param string $oid
104
-     *
105
-     * @return self
106
-     */
107
-    public static function fromOID(string $oid): self
108
-    {
109
-        return new self($oid, Element::TYPE_OBJECT_IDENTIFIER);
110
-    }
111
-
112
-    /**
113
-     * Get type tag.
114
-     *
115
-     * @return int
116
-     */
117
-    public function type(): int
118
-    {
119
-        return $this->_type;
120
-    }
121
-
122
-    /**
123
-     * Whether value type is octets.
124
-     *
125
-     * @return bool
126
-     */
127
-    public function isOctets(): bool
128
-    {
129
-        return Element::TYPE_OCTET_STRING === $this->_type;
130
-    }
131
-
132
-    /**
133
-     * Whether value type is OID.
134
-     *
135
-     * @return bool
136
-     */
137
-    public function isOID(): bool
138
-    {
139
-        return Element::TYPE_OBJECT_IDENTIFIER === $this->_type;
140
-    }
141
-
142
-    /**
143
-     * Whether value type is string.
144
-     *
145
-     * @return bool
146
-     */
147
-    public function isString(): bool
148
-    {
149
-        return Element::TYPE_UTF8_STRING === $this->_type;
150
-    }
151
-
152
-    /**
153
-     * Get value.
154
-     *
155
-     * @return string
156
-     */
157
-    public function value(): string
158
-    {
159
-        return $this->_value;
160
-    }
161
-
162
-    /**
163
-     * Generate ASN.1 structure.
164
-     *
165
-     * @throws \LogicException
166
-     *
167
-     * @return Element
168
-     */
169
-    public function toASN1(): Element
170
-    {
171
-        switch ($this->_type) {
172
-            case Element::TYPE_OCTET_STRING:
173
-                return new OctetString($this->_value);
174
-            case Element::TYPE_UTF8_STRING:
175
-                return new UTF8String($this->_value);
176
-            case Element::TYPE_OBJECT_IDENTIFIER:
177
-                return new ObjectIdentifier($this->_value);
178
-        }
179
-        throw new \LogicException(
180
-            'Type ' . Element::tagToName($this->_type) . ' not supported.');
181
-    }
20
+	/**
21
+	 * Element type tag.
22
+	 *
23
+	 * @var int
24
+	 */
25
+	protected $_type;
26
+
27
+	/**
28
+	 * Value.
29
+	 *
30
+	 * @var string
31
+	 */
32
+	protected $_value;
33
+
34
+	/**
35
+	 * Constructor.
36
+	 *
37
+	 * @param string $value
38
+	 * @param int    $type
39
+	 */
40
+	public function __construct(string $value, int $type)
41
+	{
42
+		$this->_type = $type;
43
+		$this->_value = $value;
44
+	}
45
+
46
+	/**
47
+	 * @return string
48
+	 */
49
+	public function __toString(): string
50
+	{
51
+		return $this->_value;
52
+	}
53
+
54
+	/**
55
+	 * Initialize from ASN.1.
56
+	 *
57
+	 * @param UnspecifiedType $el
58
+	 *
59
+	 * @throws \UnexpectedValueException
60
+	 *
61
+	 * @return self
62
+	 */
63
+	public static function fromASN1(UnspecifiedType $el): self
64
+	{
65
+		switch ($el->tag()) {
66
+			case Element::TYPE_OCTET_STRING:
67
+			case Element::TYPE_UTF8_STRING:
68
+				return new self($el->asString()->string(), $el->tag());
69
+			case Element::TYPE_OBJECT_IDENTIFIER:
70
+				return new self($el->asObjectIdentifier()->oid(), $el->tag());
71
+		}
72
+		throw new \UnexpectedValueException(
73
+			'Type ' . Element::tagToName($el->tag()) . ' not supported.');
74
+	}
75
+
76
+	/**
77
+	 * Initialize from octet string.
78
+	 *
79
+	 * @param string $octets
80
+	 *
81
+	 * @return self
82
+	 */
83
+	public static function fromOctets(string $octets): self
84
+	{
85
+		return new self($octets, Element::TYPE_OCTET_STRING);
86
+	}
87
+
88
+	/**
89
+	 * Initialize from UTF-8 string.
90
+	 *
91
+	 * @param string $str
92
+	 *
93
+	 * @return self
94
+	 */
95
+	public static function fromString(string $str): self
96
+	{
97
+		return new self($str, Element::TYPE_UTF8_STRING);
98
+	}
99
+
100
+	/**
101
+	 * Initialize from OID.
102
+	 *
103
+	 * @param string $oid
104
+	 *
105
+	 * @return self
106
+	 */
107
+	public static function fromOID(string $oid): self
108
+	{
109
+		return new self($oid, Element::TYPE_OBJECT_IDENTIFIER);
110
+	}
111
+
112
+	/**
113
+	 * Get type tag.
114
+	 *
115
+	 * @return int
116
+	 */
117
+	public function type(): int
118
+	{
119
+		return $this->_type;
120
+	}
121
+
122
+	/**
123
+	 * Whether value type is octets.
124
+	 *
125
+	 * @return bool
126
+	 */
127
+	public function isOctets(): bool
128
+	{
129
+		return Element::TYPE_OCTET_STRING === $this->_type;
130
+	}
131
+
132
+	/**
133
+	 * Whether value type is OID.
134
+	 *
135
+	 * @return bool
136
+	 */
137
+	public function isOID(): bool
138
+	{
139
+		return Element::TYPE_OBJECT_IDENTIFIER === $this->_type;
140
+	}
141
+
142
+	/**
143
+	 * Whether value type is string.
144
+	 *
145
+	 * @return bool
146
+	 */
147
+	public function isString(): bool
148
+	{
149
+		return Element::TYPE_UTF8_STRING === $this->_type;
150
+	}
151
+
152
+	/**
153
+	 * Get value.
154
+	 *
155
+	 * @return string
156
+	 */
157
+	public function value(): string
158
+	{
159
+		return $this->_value;
160
+	}
161
+
162
+	/**
163
+	 * Generate ASN.1 structure.
164
+	 *
165
+	 * @throws \LogicException
166
+	 *
167
+	 * @return Element
168
+	 */
169
+	public function toASN1(): Element
170
+	{
171
+		switch ($this->_type) {
172
+			case Element::TYPE_OCTET_STRING:
173
+				return new OctetString($this->_value);
174
+			case Element::TYPE_UTF8_STRING:
175
+				return new UTF8String($this->_value);
176
+			case Element::TYPE_OBJECT_IDENTIFIER:
177
+				return new ObjectIdentifier($this->_value);
178
+		}
179
+		throw new \LogicException(
180
+			'Type ' . Element::tagToName($this->_type) . ' not supported.');
181
+	}
182 182
 }
Please login to merge, or discard this patch.
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
     public static function fromASN1(UnspecifiedType $el): self
64 64
     {
65 65
         switch ($el->tag()) {
66
-            case Element::TYPE_OCTET_STRING:
67
-            case Element::TYPE_UTF8_STRING:
68
-                return new self($el->asString()->string(), $el->tag());
69
-            case Element::TYPE_OBJECT_IDENTIFIER:
70
-                return new self($el->asObjectIdentifier()->oid(), $el->tag());
66
+        case Element::TYPE_OCTET_STRING:
67
+        case Element::TYPE_UTF8_STRING:
68
+            return new self($el->asString()->string(), $el->tag());
69
+        case Element::TYPE_OBJECT_IDENTIFIER:
70
+            return new self($el->asObjectIdentifier()->oid(), $el->tag());
71 71
         }
72 72
         throw new \UnexpectedValueException(
73 73
             'Type ' . Element::tagToName($el->tag()) . ' not supported.');
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
     public function toASN1(): Element
170 170
     {
171 171
         switch ($this->_type) {
172
-            case Element::TYPE_OCTET_STRING:
173
-                return new OctetString($this->_value);
174
-            case Element::TYPE_UTF8_STRING:
175
-                return new UTF8String($this->_value);
176
-            case Element::TYPE_OBJECT_IDENTIFIER:
177
-                return new ObjectIdentifier($this->_value);
172
+        case Element::TYPE_OCTET_STRING:
173
+            return new OctetString($this->_value);
174
+        case Element::TYPE_UTF8_STRING:
175
+            return new UTF8String($this->_value);
176
+        case Element::TYPE_OBJECT_IDENTIFIER:
177
+            return new ObjectIdentifier($this->_value);
178 178
         }
179 179
         throw new \LogicException(
180 180
             'Type ' . Element::tagToName($this->_type) . ' not supported.');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
Please login to merge, or discard this patch.
X509/AttributeCertificate/Attribute/AuthenticationInfoAttributeValue.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@
 block discarded – undo
13 13
  */
14 14
 class AuthenticationInfoAttributeValue extends SvceAuthInfo
15 15
 {
16
-    const OID = '1.3.6.1.5.5.7.10.1';
16
+	const OID = '1.3.6.1.5.5.7.10.1';
17 17
 
18
-    /**
19
-     * Constructor.
20
-     *
21
-     * @param GeneralName $service
22
-     * @param GeneralName $ident
23
-     * @param null|string $auth_info
24
-     */
25
-    public function __construct(GeneralName $service, GeneralName $ident,
26
-        ?string $auth_info = null)
27
-    {
28
-        parent::__construct($service, $ident, $auth_info);
29
-        $this->_oid = self::OID;
30
-    }
18
+	/**
19
+	 * Constructor.
20
+	 *
21
+	 * @param GeneralName $service
22
+	 * @param GeneralName $ident
23
+	 * @param null|string $auth_info
24
+	 */
25
+	public function __construct(GeneralName $service, GeneralName $ident,
26
+		?string $auth_info = null)
27
+	{
28
+		parent::__construct($service, $ident, $auth_info);
29
+		$this->_oid = self::OID;
30
+	}
31 31
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
Please login to merge, or discard this patch.
lib/X509/AttributeCertificate/Attribute/IetfAttrSyntax.php 2 patches
Indentation   +187 added lines, -187 removed lines patch added patch discarded remove patch
@@ -21,191 +21,191 @@
 block discarded – undo
21 21
  */
22 22
 abstract class IetfAttrSyntax extends AttributeValue implements \Countable, \IteratorAggregate
23 23
 {
24
-    /**
25
-     * Policy authority.
26
-     *
27
-     * @var null|GeneralNames
28
-     */
29
-    protected $_policyAuthority;
30
-
31
-    /**
32
-     * Values.
33
-     *
34
-     * @var IetfAttrValue[]
35
-     */
36
-    protected $_values;
37
-
38
-    /**
39
-     * Constructor.
40
-     *
41
-     * @param IetfAttrValue ...$values
42
-     */
43
-    public function __construct(IetfAttrValue ...$values)
44
-    {
45
-        $this->_policyAuthority = null;
46
-        $this->_values = $values;
47
-    }
48
-
49
-    /**
50
-     * {@inheritdoc}
51
-     *
52
-     * @return self
53
-     */
54
-    public static function fromASN1(UnspecifiedType $el): AttributeValue
55
-    {
56
-        $seq = $el->asSequence();
57
-        $authority = null;
58
-        $idx = 0;
59
-        if ($seq->hasTagged(0)) {
60
-            $authority = GeneralNames::fromASN1(
61
-                $seq->getTagged(0)->asImplicit(Element::TYPE_SEQUENCE)
62
-                    ->asSequence());
63
-            ++$idx;
64
-        }
65
-        $values = array_map(
66
-            function (UnspecifiedType $el) {
67
-                return IetfAttrValue::fromASN1($el);
68
-            }, $seq->at($idx)->asSequence()->elements());
69
-        $obj = new static(...$values);
70
-        $obj->_policyAuthority = $authority;
71
-        return $obj;
72
-    }
73
-
74
-    /**
75
-     * Get self with policy authority.
76
-     *
77
-     * @param GeneralNames $names
78
-     *
79
-     * @return self
80
-     */
81
-    public function withPolicyAuthority(GeneralNames $names): self
82
-    {
83
-        $obj = clone $this;
84
-        $obj->_policyAuthority = $names;
85
-        return $obj;
86
-    }
87
-
88
-    /**
89
-     * Check whether policy authority is present.
90
-     *
91
-     * @return bool
92
-     */
93
-    public function hasPolicyAuthority(): bool
94
-    {
95
-        return isset($this->_policyAuthority);
96
-    }
97
-
98
-    /**
99
-     * Get policy authority.
100
-     *
101
-     * @throws \LogicException If not set
102
-     *
103
-     * @return GeneralNames
104
-     */
105
-    public function policyAuthority(): GeneralNames
106
-    {
107
-        if (!$this->hasPolicyAuthority()) {
108
-            throw new \LogicException('policyAuthority not set.');
109
-        }
110
-        return $this->_policyAuthority;
111
-    }
112
-
113
-    /**
114
-     * Get values.
115
-     *
116
-     * @return IetfAttrValue[]
117
-     */
118
-    public function values(): array
119
-    {
120
-        return $this->_values;
121
-    }
122
-
123
-    /**
124
-     * Get first value.
125
-     *
126
-     * @throws \LogicException If not set
127
-     *
128
-     * @return IetfAttrValue
129
-     */
130
-    public function first(): IetfAttrValue
131
-    {
132
-        if (!count($this->_values)) {
133
-            throw new \LogicException('No values.');
134
-        }
135
-        return $this->_values[0];
136
-    }
137
-
138
-    /**
139
-     * {@inheritdoc}
140
-     */
141
-    public function toASN1(): Element
142
-    {
143
-        $elements = [];
144
-        if (isset($this->_policyAuthority)) {
145
-            $elements[] = new ImplicitlyTaggedType(
146
-                0, $this->_policyAuthority->toASN1());
147
-        }
148
-        $values = array_map(
149
-            function (IetfAttrValue $val) {
150
-                return $val->toASN1();
151
-            }, $this->_values);
152
-        $elements[] = new Sequence(...$values);
153
-        return new Sequence(...$elements);
154
-    }
155
-
156
-    /**
157
-     * {@inheritdoc}
158
-     */
159
-    public function stringValue(): string
160
-    {
161
-        return '#' . bin2hex($this->toASN1()->toDER());
162
-    }
163
-
164
-    /**
165
-     * {@inheritdoc}
166
-     */
167
-    public function equalityMatchingRule(): MatchingRule
168
-    {
169
-        return new BinaryMatch();
170
-    }
171
-
172
-    /**
173
-     * {@inheritdoc}
174
-     */
175
-    public function rfc2253String(): string
176
-    {
177
-        return $this->stringValue();
178
-    }
179
-
180
-    /**
181
-     * Get number of values.
182
-     *
183
-     * @see \Countable::count()
184
-     *
185
-     * @return int
186
-     */
187
-    public function count(): int
188
-    {
189
-        return count($this->_values);
190
-    }
191
-
192
-    /**
193
-     * Get iterator for values.
194
-     *
195
-     * @see \IteratorAggregate::getIterator()
196
-     *
197
-     * @return \ArrayIterator
198
-     */
199
-    public function getIterator(): \ArrayIterator
200
-    {
201
-        return new \ArrayIterator($this->_values);
202
-    }
203
-
204
-    /**
205
-     * {@inheritdoc}
206
-     */
207
-    protected function _transcodedString(): string
208
-    {
209
-        return $this->stringValue();
210
-    }
24
+	/**
25
+	 * Policy authority.
26
+	 *
27
+	 * @var null|GeneralNames
28
+	 */
29
+	protected $_policyAuthority;
30
+
31
+	/**
32
+	 * Values.
33
+	 *
34
+	 * @var IetfAttrValue[]
35
+	 */
36
+	protected $_values;
37
+
38
+	/**
39
+	 * Constructor.
40
+	 *
41
+	 * @param IetfAttrValue ...$values
42
+	 */
43
+	public function __construct(IetfAttrValue ...$values)
44
+	{
45
+		$this->_policyAuthority = null;
46
+		$this->_values = $values;
47
+	}
48
+
49
+	/**
50
+	 * {@inheritdoc}
51
+	 *
52
+	 * @return self
53
+	 */
54
+	public static function fromASN1(UnspecifiedType $el): AttributeValue
55
+	{
56
+		$seq = $el->asSequence();
57
+		$authority = null;
58
+		$idx = 0;
59
+		if ($seq->hasTagged(0)) {
60
+			$authority = GeneralNames::fromASN1(
61
+				$seq->getTagged(0)->asImplicit(Element::TYPE_SEQUENCE)
62
+					->asSequence());
63
+			++$idx;
64
+		}
65
+		$values = array_map(
66
+			function (UnspecifiedType $el) {
67
+				return IetfAttrValue::fromASN1($el);
68
+			}, $seq->at($idx)->asSequence()->elements());
69
+		$obj = new static(...$values);
70
+		$obj->_policyAuthority = $authority;
71
+		return $obj;
72
+	}
73
+
74
+	/**
75
+	 * Get self with policy authority.
76
+	 *
77
+	 * @param GeneralNames $names
78
+	 *
79
+	 * @return self
80
+	 */
81
+	public function withPolicyAuthority(GeneralNames $names): self
82
+	{
83
+		$obj = clone $this;
84
+		$obj->_policyAuthority = $names;
85
+		return $obj;
86
+	}
87
+
88
+	/**
89
+	 * Check whether policy authority is present.
90
+	 *
91
+	 * @return bool
92
+	 */
93
+	public function hasPolicyAuthority(): bool
94
+	{
95
+		return isset($this->_policyAuthority);
96
+	}
97
+
98
+	/**
99
+	 * Get policy authority.
100
+	 *
101
+	 * @throws \LogicException If not set
102
+	 *
103
+	 * @return GeneralNames
104
+	 */
105
+	public function policyAuthority(): GeneralNames
106
+	{
107
+		if (!$this->hasPolicyAuthority()) {
108
+			throw new \LogicException('policyAuthority not set.');
109
+		}
110
+		return $this->_policyAuthority;
111
+	}
112
+
113
+	/**
114
+	 * Get values.
115
+	 *
116
+	 * @return IetfAttrValue[]
117
+	 */
118
+	public function values(): array
119
+	{
120
+		return $this->_values;
121
+	}
122
+
123
+	/**
124
+	 * Get first value.
125
+	 *
126
+	 * @throws \LogicException If not set
127
+	 *
128
+	 * @return IetfAttrValue
129
+	 */
130
+	public function first(): IetfAttrValue
131
+	{
132
+		if (!count($this->_values)) {
133
+			throw new \LogicException('No values.');
134
+		}
135
+		return $this->_values[0];
136
+	}
137
+
138
+	/**
139
+	 * {@inheritdoc}
140
+	 */
141
+	public function toASN1(): Element
142
+	{
143
+		$elements = [];
144
+		if (isset($this->_policyAuthority)) {
145
+			$elements[] = new ImplicitlyTaggedType(
146
+				0, $this->_policyAuthority->toASN1());
147
+		}
148
+		$values = array_map(
149
+			function (IetfAttrValue $val) {
150
+				return $val->toASN1();
151
+			}, $this->_values);
152
+		$elements[] = new Sequence(...$values);
153
+		return new Sequence(...$elements);
154
+	}
155
+
156
+	/**
157
+	 * {@inheritdoc}
158
+	 */
159
+	public function stringValue(): string
160
+	{
161
+		return '#' . bin2hex($this->toASN1()->toDER());
162
+	}
163
+
164
+	/**
165
+	 * {@inheritdoc}
166
+	 */
167
+	public function equalityMatchingRule(): MatchingRule
168
+	{
169
+		return new BinaryMatch();
170
+	}
171
+
172
+	/**
173
+	 * {@inheritdoc}
174
+	 */
175
+	public function rfc2253String(): string
176
+	{
177
+		return $this->stringValue();
178
+	}
179
+
180
+	/**
181
+	 * Get number of values.
182
+	 *
183
+	 * @see \Countable::count()
184
+	 *
185
+	 * @return int
186
+	 */
187
+	public function count(): int
188
+	{
189
+		return count($this->_values);
190
+	}
191
+
192
+	/**
193
+	 * Get iterator for values.
194
+	 *
195
+	 * @see \IteratorAggregate::getIterator()
196
+	 *
197
+	 * @return \ArrayIterator
198
+	 */
199
+	public function getIterator(): \ArrayIterator
200
+	{
201
+		return new \ArrayIterator($this->_values);
202
+	}
203
+
204
+	/**
205
+	 * {@inheritdoc}
206
+	 */
207
+	protected function _transcodedString(): string
208
+	{
209
+		return $this->stringValue();
210
+	}
211 211
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             ++$idx;
64 64
         }
65 65
         $values = array_map(
66
-            function (UnspecifiedType $el) {
66
+            function(UnspecifiedType $el) {
67 67
                 return IetfAttrValue::fromASN1($el);
68 68
             }, $seq->at($idx)->asSequence()->elements());
69 69
         $obj = new static(...$values);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 0, $this->_policyAuthority->toASN1());
147 147
         }
148 148
         $values = array_map(
149
-            function (IetfAttrValue $val) {
149
+            function(IetfAttrValue $val) {
150 150
                 return $val->toASN1();
151 151
             }, $this->_values);
152 152
         $elements[] = new Sequence(...$values);
Please login to merge, or discard this patch.
lib/X509/AttributeCertificate/Attribute/ChargingIdentityAttributeValue.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@
 block discarded – undo
11 11
  */
12 12
 class ChargingIdentityAttributeValue extends IetfAttrSyntax
13 13
 {
14
-    const OID = '1.3.6.1.5.5.7.10.3';
14
+	const OID = '1.3.6.1.5.5.7.10.3';
15 15
 
16
-    /**
17
-     * Constructor.
18
-     *
19
-     * @param IetfAttrValue ...$values
20
-     */
21
-    public function __construct(IetfAttrValue ...$values)
22
-    {
23
-        parent::__construct(...$values);
24
-        $this->_oid = self::OID;
25
-    }
16
+	/**
17
+	 * Constructor.
18
+	 *
19
+	 * @param IetfAttrValue ...$values
20
+	 */
21
+	public function __construct(IetfAttrValue ...$values)
22
+	{
23
+		parent::__construct(...$values);
24
+		$this->_oid = self::OID;
25
+	}
26 26
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Sop\X509\AttributeCertificate\Attribute;
6 6
 
Please login to merge, or discard this patch.