1 | <?php |
||
12 | class CertificateBundle implements \Countable, \IteratorAggregate |
||
13 | { |
||
14 | /** |
||
15 | * Certificates. |
||
16 | * |
||
17 | * @var Certificate[] $_certs |
||
18 | */ |
||
19 | protected $_certs; |
||
20 | |||
21 | /** |
||
22 | * Mapping from public key id to array of certificates. |
||
23 | * |
||
24 | * @var (Certificate[])[] |
||
25 | */ |
||
26 | private $_keyIdMap; |
||
27 | |||
28 | /** |
||
29 | * Constructor. |
||
30 | * |
||
31 | * @param Certificate ...$certs Certificate objects |
||
32 | */ |
||
33 | 17 | public function __construct(Certificate ...$certs) { |
|
36 | |||
37 | /** |
||
38 | * Reset internal cached variables on clone. |
||
39 | */ |
||
40 | 1 | public function __clone() { |
|
43 | |||
44 | /** |
||
45 | * Initialize from PEMs. |
||
46 | * |
||
47 | * @param PEM ...$pems PEM objects |
||
48 | * @return self |
||
49 | */ |
||
50 | 2 | public static function fromPEMs(PEM ...$pems) { |
|
57 | |||
58 | /** |
||
59 | * Initialize from PEM bundle. |
||
60 | * |
||
61 | * @param PEMBundle $pem_bundle |
||
62 | * @return self |
||
63 | */ |
||
64 | 1 | public static function fromPEMBundle(PEMBundle $pem_bundle) { |
|
67 | |||
68 | /** |
||
69 | * Get self with certificates added. |
||
70 | * |
||
71 | * @param Certificate ...$cert |
||
72 | * @return self |
||
73 | */ |
||
74 | 1 | public function withCertificates(Certificate ...$cert) { |
|
79 | |||
80 | /** |
||
81 | * Get self with certificates from PEMBundle added. |
||
82 | * |
||
83 | * @param PEMBundle $pem_bundle |
||
84 | * @return self |
||
85 | */ |
||
86 | 1 | public function withPEMBundle(PEMBundle $pem_bundle) { |
|
93 | |||
94 | /** |
||
95 | * Get self with single certificate from PEM added. |
||
96 | * |
||
97 | * @param PEM $pem |
||
98 | * @return self |
||
99 | */ |
||
100 | 1 | public function withPEM(PEM $pem) { |
|
105 | |||
106 | /** |
||
107 | * Check whether bundle contains a given certificate. |
||
108 | * |
||
109 | * @param Certificate $cert |
||
110 | * @return bool |
||
111 | */ |
||
112 | 3 | public function contains(Certificate $cert) { |
|
126 | |||
127 | /** |
||
128 | * Get all certificates that have given subject key identifier. |
||
129 | * |
||
130 | * @param string $id |
||
131 | * @return Certificate[] |
||
132 | */ |
||
133 | 11 | public function allBySubjectKeyIdentifier($id) { |
|
140 | |||
141 | /** |
||
142 | * Get all certificates in a bundle. |
||
143 | * |
||
144 | * @return Certificate[] |
||
145 | */ |
||
146 | 1 | public function all() { |
|
149 | |||
150 | /** |
||
151 | * Get certificate mapping by public key id. |
||
152 | * |
||
153 | * @return (Certificate[])[] |
||
154 | */ |
||
155 | 14 | private function _getKeyIdMap() { |
|
169 | |||
170 | /** |
||
171 | * Get public key id for the certificate. |
||
172 | * |
||
173 | * @param Certificate $cert |
||
174 | * @return string |
||
175 | */ |
||
176 | 13 | private static function _getCertKeyId(Certificate $cert) { |
|
185 | |||
186 | /** |
||
187 | * |
||
188 | * @see Countable::count() |
||
189 | * @return int |
||
190 | */ |
||
191 | 4 | public function count() { |
|
194 | |||
195 | /** |
||
196 | * Get iterator for certificates. |
||
197 | * |
||
198 | * @see IteratorAggregate::getIterator() |
||
199 | * @return \ArrayIterator |
||
200 | */ |
||
201 | 1 | public function getIterator() { |
|
204 | } |
||
205 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..