1 | <?php |
||
26 | trait EntityDescriptor |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * IDP descriptors from the metadata |
||
31 | * @see AbstractProvider::getMetadataModel() |
||
32 | * @var IDPSSODescriptor[] |
||
33 | */ |
||
34 | private $idpSsoDescriptors = []; |
||
35 | |||
36 | /** |
||
37 | * SP descriptors from the metadata |
||
38 | * @see AbstractProvider::getMetadataModel() |
||
39 | * @var SPSSODescriptor[] |
||
40 | */ |
||
41 | private $spSsoDescriptors = []; |
||
42 | |||
43 | /** |
||
44 | * Get the role descriptors from metadata |
||
45 | * @return IDPSSODescriptor[] |
||
46 | */ |
||
47 | public function idpSsoDescriptors() |
||
55 | |||
56 | /** |
||
57 | * Get the role descriptors from metadata |
||
58 | * @return SPSSODescriptor[] |
||
59 | */ |
||
60 | public function spSsoDescriptors() |
||
68 | |||
69 | /** |
||
70 | * @param null $binding |
||
71 | * @return IndexedEndpointType|null |
||
72 | */ |
||
73 | public function firstSpAcsService($binding = null) |
||
77 | |||
78 | /** SSO */ |
||
79 | |||
80 | /** |
||
81 | * @param null $binding |
||
82 | * @return IndexedEndpointType|null |
||
83 | */ |
||
84 | public function firstIdpSsoService($binding = null) |
||
88 | |||
89 | /** SLO */ |
||
90 | |||
91 | /** |
||
92 | * @param null $binding |
||
93 | * @return IndexedEndpointType|null |
||
94 | */ |
||
95 | public function firstIdpSloService($binding = null) |
||
99 | |||
100 | /** |
||
101 | * @param null $binding |
||
102 | * @return IndexedEndpointType|null |
||
103 | */ |
||
104 | public function firstSpSloService($binding = null) |
||
108 | |||
109 | /** X509s */ |
||
110 | |||
111 | /** |
||
112 | * @return XMLSecurityKey |
||
113 | * @throws \Exception |
||
114 | */ |
||
115 | public function signingXMLSecurityKey() |
||
123 | |||
124 | /** |
||
125 | * @return array |
||
126 | * @throws \Exception |
||
127 | */ |
||
128 | public function signingXMLSecurityKeyStore() |
||
148 | |||
149 | /** |
||
150 | * @return XMLSecurityKey|null |
||
151 | * @throws \Exception |
||
152 | * |
||
153 | * For Decryption |
||
154 | * @see SecurityHelper::decryptAssertion() |
||
155 | */ |
||
156 | public function encryptionKey() |
||
179 | |||
180 | /** |
||
181 | * @param X509Certificate $certificate |
||
182 | * @return XMLSecurityKey |
||
183 | * @throws \Exception |
||
184 | */ |
||
185 | protected function certificateToXMLSecurityKey(X509Certificate $certificate) |
||
204 | |||
205 | /** |
||
206 | * @param array $certificates |
||
207 | * @return array |
||
208 | * @throws \Exception |
||
209 | */ |
||
210 | protected function certificatesToXMLSecurityKeyStore(array $certificates) |
||
218 | |||
219 | /** |
||
220 | * @param array $keyDescriptors |
||
221 | * @param string $signingOrEncrypt |
||
222 | * @return KeyDescriptor|null |
||
223 | */ |
||
224 | protected function firstKeyDescriptor(array $keyDescriptors, string $signingOrEncrypt) |
||
231 | |||
232 | /** |
||
233 | * @return X509Certificate|null |
||
234 | */ |
||
235 | protected function firstCertificateForSigning() |
||
239 | |||
240 | /** |
||
241 | * @return X509Certificate|null |
||
242 | */ |
||
243 | protected function firstCertificateForEncryption() |
||
247 | |||
248 | /** |
||
249 | * @return X509Certificate|null |
||
250 | */ |
||
251 | protected function firstCertificate($use) |
||
268 | |||
269 | /** |
||
270 | * @return KeyDescriptor[] |
||
271 | */ |
||
272 | private function keyDescriptors() |
||
289 | |||
290 | /** |
||
291 | * @param array $keyDescriptors |
||
292 | * @param string $signingOrEncrypt |
||
293 | * @return KeyDescriptor[] |
||
294 | */ |
||
295 | private function keyDescriptorsByType(array $keyDescriptors, string $signingOrEncrypt) |
||
308 | |||
309 | /** |
||
310 | * @param KeyDescriptor $keyDescriptor |
||
311 | * @return array|X509Certificate[] |
||
312 | */ |
||
313 | private function x509Certificates(KeyDescriptor $keyDescriptor) |
||
338 | |||
339 | /** |
||
340 | * @return string |
||
341 | */ |
||
342 | public function toXmlString() |
||
346 | |||
347 | /** |
||
348 | * @return string |
||
349 | */ |
||
350 | public function __toString() |
||
354 | } |
||
355 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.