Skip to content

Commit 9a47a32

Browse files
committed
Typed constants and phpdoc-cleanup
1 parent 6010a63 commit 9a47a32

71 files changed

Lines changed: 56 additions & 355 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/SAML11/Assert/SAMLAnyURITrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
trait SAMLAnyURITrait
1414
{
1515
/**
16-
* @param string $value
17-
* @param string $message
1816
*/
1917
protected static function validSAMLAnyURI(string $value, string $message = ''): void
2018
{

src/SAML11/Assert/SAMLDateTimeTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
trait SAMLDateTimeTrait
1414
{
1515
/**
16-
* @param string $value
17-
* @param string $message
1816
*/
1917
protected static function validSAMLDateTime(string $value, string $message = ''): void
2018
{

src/SAML11/Assert/SAMLStringTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
trait SAMLStringTrait
1515
{
1616
/**
17-
* @param string $value
18-
* @param string $message
1917
*/
2018
protected static function validSAMLString(string $value, string $message = ''): void
2119
{

src/SAML11/Compat/AbstractContainer.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ public function getBlacklistedEncryptionAlgorithms(): ?array
4949
/**
5050
* Register a class that can handle a given element.
5151
*
52-
* @param string $class The class name of a class extending AbstractElement
53-
* @psalm-param class-string $class
52+
* @param class-string $class The class name of a class extending AbstractElement
5453
*/
5554
public function registerElementHandler(string $class): void
5655
{
@@ -63,8 +62,7 @@ public function registerElementHandler(string $class): void
6362
/**
6463
* Register a class that can handle given extension points of the standard.
6564
*
66-
* @param string $class The class name of a class extending AbstractElement or implementing ExtensionPointInterface.
67-
* @psalm-param class-string $class
65+
* @param class-string $class The class name of a class extending AbstractElement or implementing ExtensionPointInterface.
6866
*/
6967
public function registerExtensionHandler(string $class): void
7068
{
@@ -82,9 +80,8 @@ public function registerExtensionHandler(string $class): void
8280
*
8381
* @param \SimpleSAML\XMLSchema\Type\QNameValue|null $qName The qualified name of the element.
8482
*
85-
* @return string|null The fully-qualified name of a class extending \SimpleSAML\XML\AbstractElement and
83+
* @return class-string|null The fully-qualified name of a class extending \SimpleSAML\XML\AbstractElement and
8684
* implementing support for the given element, or null if no such class has been registered before.
87-
* @psalm-return class-string|null
8885
*/
8986
public function getElementHandler(QNameValue $qName): ?string
9087
{
@@ -105,9 +102,8 @@ public function getElementHandler(QNameValue $qName): ?string
105102
* implement \SimpleSAML\SAML11\XML\saml\ExtensionPointInterface.
106103
*
107104
* @param \SimpleSAML\XMLSchema\Type\QNameValue $qName The qualified name of the extension.
108-
* @return string|null The fully-qualified name of a class implementing
105+
* @return class-string|null The fully-qualified name of a class implementing
109106
* \SimpleSAML\SAML11\XML\saml\ExtensionPointInterface or null if no such class has been registered before.
110-
* @psalm-return class-string|null
111107
*/
112108
public function getExtensionHandler(QNameValue $qName): ?string
113109
{
@@ -123,6 +119,7 @@ public function getExtensionHandler(QNameValue $qName): ?string
123119

124120
/**
125121
* Get a PSR-3 compatible logger.
122+
*
126123
* @return \Psr\Log\LoggerInterface
127124
*/
128125
abstract public function getLogger(): LoggerInterface;

src/SAML11/Compat/MockContainer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public function getLogger(): LoggerInterface
3131
* Set the system clock
3232
*
3333
* @param \Psr\Clock\ClockInterface $clock
34-
* @return void
3534
*/
3635
public function setClock(ClockInterface $clock): void
3736
{

src/SAML11/Constants.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,98 +14,98 @@ class Constants extends \SimpleSAML\XMLSecurity\Constants
1414
/**
1515
* Password authentication context.
1616
*/
17-
public const AC_PASSWORD = 'urn:oasis:names:tc:SAML:1.0:am:password';
17+
public const string AC_PASSWORD = 'urn:oasis:names:tc:SAML:1.0:am:password';
1818

1919
/**
2020
* Kerberos authentication context.
2121
*/
22-
public const AC_KERBEROS = 'urn:ietf:rfc:1510';
22+
public const string AC_KERBEROS = 'urn:ietf:rfc:1510';
2323

2424
/**
2525
* Secure Remote Password authentication context.
2626
*/
27-
public const AC_SECURE_REMOTE_PASSWORD = 'urn:ietf:rfc:2945';
27+
public const string AC_SECURE_REMOTE_PASSWORD = 'urn:ietf:rfc:2945';
2828

2929
/**
3030
* Hardware token authentication context.
3131
*/
32-
public const AC_HARDWARE_TOKEN = 'urn:oasis:names:tc:SAML:1.0:am:HardwareToken';
32+
public const string AC_HARDWARE_TOKEN = 'urn:oasis:names:tc:SAML:1.0:am:HardwareToken';
3333

3434
/**
3535
* Certificate based client authentication authentication context.
3636
*/
37-
public const AC_CERT_BASE_CLIENT_AUTHN = 'urn:ietf:rfc:2246';
37+
public const string AC_CERT_BASE_CLIENT_AUTHN = 'urn:ietf:rfc:2246';
3838

3939
/**
4040
* X.509 Public key authentication context.
4141
*/
42-
public const AC_X509_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:X509-PKI';
42+
public const string AC_X509_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:X509-PKI';
4343

4444
/**
4545
* PGP Public key authentication context.
4646
*/
47-
public const AC_PGP_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:PGP';
47+
public const string AC_PGP_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:PGP';
4848

4949
/**
5050
* SPKI Public key authentication context.
5151
*/
52-
public const AC_SPKI_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:SPKI';
52+
public const string AC_SPKI_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:SPKI';
5353

5454
/**
5555
* XKMS Public key authentication context.
5656
*/
57-
public const AC_XMLS_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:XKMS';
57+
public const string AC_XMLS_PUBLIC_KEY = 'urn:oasis:names:tc:SAML:1.0:am:XKMS';
5858

5959
/**
6060
* XML Digital Signature authentication context.
6161
*/
62-
public const AC_XML_DSIG = 'urn:ietf:rfc:3075';
62+
public const string AC_XML_DSIG = 'urn:ietf:rfc:3075';
6363

6464
/**
6565
* Unspecified authentication context.
6666
*/
67-
public const AC_UNSPECIFIED = 'urn:oasis:names:tc:SAML:1.0:am:unspecified';
67+
public const string AC_UNSPECIFIED = 'urn:oasis:names:tc:SAML:1.0:am:unspecified';
6868

6969
/**
7070
* Artifact subject confirmation method.
7171
*/
72-
public const CM_ARTIFACT = 'urn:oasis:names:tc:SAML:1.0:cm:artifact';
72+
public const string CM_ARTIFACT = 'urn:oasis:names:tc:SAML:1.0:cm:artifact';
7373

7474
/**
7575
* Bearer subject confirmation method.
7676
*/
77-
public const CM_BEARER = 'urn:oasis:names:tc:SAML:1.0:cm:bearer';
77+
public const string CM_BEARER = 'urn:oasis:names:tc:SAML:1.0:cm:bearer';
7878

7979
/**
8080
* Email address NameID format.
8181
*/
82-
public const NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress';
82+
public const string NAMEID_EMAIL_ADDRESS = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress';
8383

8484
/**
8585
* Unspecified NameID format.
8686
*/
87-
public const NAMEID_UNSPECIFIED = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified';
87+
public const string NAMEID_UNSPECIFIED = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified';
8888

8989
/**
9090
* Windows Domain Qualifier Name NameID format.
9191
*/
92-
public const NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME =
92+
public const string NAMEID_WINDOWS_DOMAIN_QUALIFIED_NAME =
9393
'urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName';
9494

9595
/**
9696
* X509 Subject Name NameID format.
9797
*/
98-
public const NAMEID_X509_SUBJECT_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName';
98+
public const string NAMEID_X509_SUBJECT_NAME = 'urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName';
9999

100100
/**
101101
* The namespace for the SAML 1.1 assertions.
102102
*/
103-
public const NS_SAML = 'urn:oasis:names:tc:SAML:1.0:assertion';
103+
public const string NS_SAML = 'urn:oasis:names:tc:SAML:1.0:assertion';
104104

105105
/**
106106
* The namespace for the SAML 1.1 protocol.
107107
*/
108-
public const NS_SAMLP = 'urn:oasis:names:tc:SAML:1.0:protocol';
108+
public const string NS_SAMLP = 'urn:oasis:names:tc:SAML:1.0:protocol';
109109

110110
/**
111111
* The SAML responder or SAML authority is able to process the request but has chosen not to respond.
@@ -114,51 +114,51 @@ class Constants extends \SimpleSAML\XMLSecurity\Constants
114114
*
115115
* Second-level status code.
116116
*/
117-
public const STATUS_REQUEST_DENIED = 'samlp:RequestDenied';
117+
public const string STATUS_REQUEST_DENIED = 'samlp:RequestDenied';
118118

119119
/**
120120
* The SAML responder cannot process any requests with the protocol version specified in the request.
121121
*
122122
* Second-level status code.
123123
*/
124-
public const STATUS_REQUEST_VERSION_DEPRECATED = 'samlp:RequestVersionDeprecated';
124+
public const string STATUS_REQUEST_VERSION_DEPRECATED = 'samlp:RequestVersionDeprecated';
125125

126126
/**
127127
* The SAML responder cannot process the request because the protocol version specified in the request message
128128
* is a major upgrade from the highest protocol version supported by the responder.
129129
*
130130
* Second-level status code.
131131
*/
132-
public const STATUS_REQUEST_VERSION_TOO_HIGH = 'samlp:RequestVersionTooHigh';
132+
public const string STATUS_REQUEST_VERSION_TOO_HIGH = 'samlp:RequestVersionTooHigh';
133133

134134
/**
135135
* The SAML responder cannot process the request because the protocol version specified in the request message
136136
* is too low.
137137
*
138138
* Second-level status code.
139139
*/
140-
public const STATUS_REQUEST_VERSION_TOO_LOW = 'samlp:RequestVersionTooLow';
140+
public const string STATUS_REQUEST_VERSION_TOO_LOW = 'samlp:RequestVersionTooLow';
141141

142142
/**
143143
* The request could not be performed due to an error on the part of the requester.
144144
*
145145
* Top-level status code.
146146
*/
147-
public const STATUS_REQUESTER = 'samlp:Requester';
147+
public const string STATUS_REQUESTER = 'samlp:Requester';
148148

149149
/**
150150
* The resource value provided in the request message is invalid or unrecognized.
151151
*
152152
* Second-level status code.
153153
*/
154-
public const STATUS_RESOURCE_NOT_RECOGNIZED = 'samlp:ResourceNotRecognized';
154+
public const string STATUS_RESOURCE_NOT_RECOGNIZED = 'samlp:ResourceNotRecognized';
155155

156156
/**
157157
* The request could not be performed due to an error on the part of the SAML responder or SAML authority.
158158
*
159159
* Top-level status code.
160160
*/
161-
public const STATUS_RESPONDER = 'samlp:Responder';
161+
public const string STATUS_RESPONDER = 'samlp:Responder';
162162

163163
/**
164164
* Top-level status code indicating successful processing of the request.
@@ -167,21 +167,21 @@ class Constants extends \SimpleSAML\XMLSecurity\Constants
167167
*
168168
* Top-level status code.
169169
*/
170-
public const STATUS_SUCCESS = 'samlp:Success';
170+
public const string STATUS_SUCCESS = 'samlp:Success';
171171

172172
/**
173173
* The response message would contain more elements than the SAML responder is able to return.
174174
*
175175
* Second-level status code.
176176
*/
177-
public const STATUS_TOO_MANY_RESPONSES = 'samlp:TooManyResponses';
177+
public const string STATUS_TOO_MANY_RESPONSES = 'samlp:TooManyResponses';
178178

179179
/**
180180
* The SAML responder could not process the request because the version of the request message was incorrect.
181181
*
182182
* Top-level status code.
183183
*/
184-
public const STATUS_VERSION_MISMATCH = 'samlp:VersionMismatch';
184+
public const string STATUS_VERSION_MISMATCH = 'samlp:VersionMismatch';
185185

186186

187187
/** @var string[] */

src/SAML11/Exception/ProtocolViolationException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
class ProtocolViolationException extends RuntimeException
1313
{
1414
/**
15-
* @param string $message
1615
*/
1716
public function __construct(string $message = '')
1817
{

src/SAML11/Exception/VersionMismatchException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
class VersionMismatchException extends RuntimeException
1313
{
1414
/**
15-
* @param string $message
1615
*/
1716
public function __construct(string $message = '')
1817
{

src/SAML11/Type/DecisionTypeValue.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@
1616
*/
1717
class DecisionTypeValue extends StringValue
1818
{
19-
/** @var string */
20-
public const SCHEMA_TYPE = 'decisionType';
19+
public const string SCHEMA_TYPE = 'decisionType';
2120

2221

2322
/**
2423
* Validate the value.
2524
*
26-
* @param string $value The value
2725
* @throws \Exception on failure
28-
* @return void
2926
*/
3027
protected function validateValue(string $value): void
3128
{
@@ -39,7 +36,6 @@ protected function validateValue(string $value): void
3936

4037
/**
4138
* @param \SimpleSAML\SAML11\XML\Enumeration\DecisionTypeEnum $value
42-
* @return static
4339
*/
4440
public static function fromEnum(DecisionTypeEnum $value): static
4541
{

src/SAML11/Type/SAMLAnyURIValue.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ class SAMLAnyURIValue extends AnyURIValue
1414
{
1515
/**
1616
* Validate the value.
17-
*
18-
* @param string $value
19-
* @return void
2017
*/
2118
protected function validateValue(string $value): void
2219
{

0 commit comments

Comments
 (0)