Skip to content

Commit 9b95cbd

Browse files
committed
Typed constants
1 parent 069431d commit 9b95cbd

41 files changed

Lines changed: 72 additions & 167 deletions

Some content is hidden

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

src/Constants.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,46 @@ class Constants extends \SimpleSAML\XML\Constants
1515
/**
1616
* The namespace for WS-Addressing protocol.
1717
*/
18-
public const NS_ADDR_200408 = 'http://schemas.xmlsoap.org/ws/2004/08/addressing';
18+
public const string NS_ADDR_200408 = 'http://schemas.xmlsoap.org/ws/2004/08/addressing';
1919

20-
public const NS_ADDR_200508 = 'http://www.w3.org/2005/08/addressing';
20+
public const string NS_ADDR_200508 = 'http://www.w3.org/2005/08/addressing';
2121

2222
/**
2323
* The namespace for the WS-Addressing - Metadata.
2424
*/
25-
public const NS_ADDR_METADATA = 'http://www.w3.org/2007/02/addressing/metadata';
25+
public const string NS_ADDR_METADATA = 'http://www.w3.org/2007/02/addressing/metadata';
2626

2727
/**
2828
* The namespace for the WS-Addressing - WSDL Binding.
2929
*/
30-
public const NS_ADDR_WSDL = 'http://www.w3.org/2006/05/addressing/wsdl';
30+
public const string NS_ADDR_WSDL = 'http://www.w3.org/2006/05/addressing/wsdl';
3131

3232
/**
3333
* The schema-defined wsa fault codes
3434
*/
35-
public const WSA_FAULT_INVALID_ADDRESSING_HEADER = 'InvalidAddressingHeader';
35+
public const string WSA_FAULT_INVALID_ADDRESSING_HEADER = 'InvalidAddressingHeader';
3636

37-
public const WSA_FAULT_INVALID_ADDRESS = 'InvalidAddress';
37+
public const string WSA_FAULT_INVALID_ADDRESS = 'InvalidAddress';
3838

39-
public const WSA_FAULT_INVALID_EPR = 'InvalidEPR';
39+
public const string WSA_FAULT_INVALID_EPR = 'InvalidEPR';
4040

41-
public const WSA_FAULT_INVALID_CARDINALITY = 'InvalidCardinality';
41+
public const string WSA_FAULT_INVALID_CARDINALITY = 'InvalidCardinality';
4242

43-
public const WSA_FAULT_MISSING_ADDRESS_IN_EPR = 'MissingAddressInEPR';
43+
public const string WSA_FAULT_MISSING_ADDRESS_IN_EPR = 'MissingAddressInEPR';
4444

45-
public const WSA_FAULT_DUPLICATE_MESSAGEID = 'DupicateMessageID';
45+
public const string WSA_FAULT_DUPLICATE_MESSAGEID = 'DupicateMessageID';
4646

47-
public const WSA_FAULT_ACTION_MISMATCH = 'ActionMismatch';
47+
public const string WSA_FAULT_ACTION_MISMATCH = 'ActionMismatch';
4848

49-
public const WSA_FAULT_MESSAGE_ADDRESSING_HEADER_REQUIRED = 'MessageAddressingHeaderRequired';
49+
public const string WSA_FAULT_MESSAGE_ADDRESSING_HEADER_REQUIRED = 'MessageAddressingHeaderRequired';
5050

51-
public const WSA_FAULT_DESTINATION_UNREACHABLE = 'DestinationUnreachable';
51+
public const string WSA_FAULT_DESTINATION_UNREACHABLE = 'DestinationUnreachable';
5252

53-
public const WSA_FAULT_ACTION_NOT_SUPPORTED = 'ActionNotSupported';
53+
public const string WSA_FAULT_ACTION_NOT_SUPPORTED = 'ActionNotSupported';
5454

55-
public const WSA_FAULT_ENDPOINT_UNAVAILABLE = 'EndpointUnavailable';
55+
public const string WSA_FAULT_ENDPOINT_UNAVAILABLE = 'EndpointUnavailable';
5656

57-
public const FAULT_CODES = [
57+
public const array FAULT_CODES = [
5858
self::WSA_FAULT_INVALID_ADDRESSING_HEADER,
5959
self::WSA_FAULT_INVALID_ADDRESS,
6060
self::WSA_FAULT_INVALID_EPR,

src/XML/wsa_200408/AbstractAttributedQNameType.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ abstract class AbstractAttributedQNameType extends AbstractWsaElement
2727
use TypedTextContentTrait;
2828

2929

30-
/** @var string */
31-
public const TEXTCONTENT_TYPE = QNameValue::class;
30+
public const string TEXTCONTENT_TYPE = QNameValue::class;
3231

3332
/** The namespace-attribute for the xs:anyElement element */
34-
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER;
33+
public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER;
3534

3635

3736
/**
@@ -51,7 +50,6 @@ final public function __construct(QNameValue $value, array $namespacedAttributes
5150
* Convert XML into a class instance
5251
*
5352
* @param \DOMElement $xml The XML element we should load
54-
* @return static
5553
*
5654
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
5755
* If the qualified name of the supplied element is wrong
@@ -69,7 +67,6 @@ public static function fromXML(DOMElement $xml): static
6967
* Convert this element to XML.
7068
*
7169
* @param \DOMElement|null $parent The element we should append this element to.
72-
* @return \DOMElement
7370
*/
7471
public function toXML(?DOMElement $parent = null): DOMElement
7572
{

src/XML/wsa_200408/AbstractAttributedURIType.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ abstract class AbstractAttributedURIType extends AbstractWsaElement
2727
use TypedTextContentTrait;
2828

2929

30-
/** @var string */
31-
public const TEXTCONTENT_TYPE = AnyURIValue::class;
30+
public const string TEXTCONTENT_TYPE = AnyURIValue::class;
3231

3332
/** The namespace-attribute for the xs:anyAttribute element */
34-
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER;
33+
public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER;
3534

3635

3736
/**
@@ -51,7 +50,6 @@ final public function __construct(AnyURIValue $value, array $namespacedAttribute
5150
* Convert XML into a class instance
5251
*
5352
* @param \DOMElement $xml The XML element we should load
54-
* @return static
5553
*
5654
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
5755
* If the qualified name of the supplied element is wrong
@@ -69,7 +67,6 @@ public static function fromXML(DOMElement $xml): static
6967
* Convert this element to XML.
7068
*
7169
* @param \DOMElement|null $parent The element we should append this element to.
72-
* @return \DOMElement
7370
*/
7471
public function toXML(?DOMElement $parent = null): DOMElement
7572
{

src/XML/wsa_200408/AbstractEndpointReferenceType.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ abstract class AbstractEndpointReferenceType extends AbstractWsaElement
3232

3333

3434
/** The namespace-attribute for the xs:any element */
35-
public const XS_ANY_ELT_NAMESPACE = NS::OTHER;
35+
public const string XS_ANY_ELT_NAMESPACE = NS::OTHER;
3636

3737
/** The namespace-attribute for the xs:anyAttribute element */
38-
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER;
38+
public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER;
3939

4040

4141
/**
@@ -126,7 +126,6 @@ public function getServiceName(): ?ServiceName
126126
* Note: this method cannot be used when extending this class, if the constructor has a different signature.
127127
*
128128
* @param \DOMElement $xml The XML element we should load.
129-
* @return static
130129
*
131130
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
132131
* if the qualified name of the supplied element is wrong
@@ -175,7 +174,6 @@ public static function fromXML(DOMElement $xml): static
175174
* Add this endpoint reference to an XML element.
176175
*
177176
* @param \DOMElement|null $parent The element we should append this endpoint to.
178-
* @return \DOMElement
179177
*/
180178
public function toXML(?DOMElement $parent = null): DOMElement
181179
{

src/XML/wsa_200408/AbstractRelationshipType.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ abstract class AbstractRelationshipType extends AbstractWsaElement
2828
use TypedTextContentTrait;
2929

3030

31-
/** @var string */
32-
public const TEXTCONTENT_TYPE = AnyURIValue::class;
31+
public const string TEXTCONTENT_TYPE = AnyURIValue::class;
3332

3433
/** The namespace-attribute for the xs:anyAttribute element */
35-
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER;
34+
public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER;
3635

3736

3837
/**
@@ -65,7 +64,6 @@ public function getRelationshipType(): ?QNameValue
6564
* Convert XML into a class instance
6665
*
6766
* @param \DOMElement $xml The XML element we should load
68-
* @return static
6967
*
7068
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
7169
* If the qualified name of the supplied element is wrong
@@ -87,7 +85,6 @@ public static function fromXML(DOMElement $xml): static
8785
* Convert this element to XML.
8886
*
8987
* @param \DOMElement|null $parent The element we should append this element to.
90-
* @return \DOMElement
9188
*/
9289
public function toXML(?DOMElement $parent = null): DOMElement
9390
{

src/XML/wsa_200408/AbstractRetryAfterType.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ abstract class AbstractRetryAfterType extends AbstractWsaElement
2727
use TypedTextContentTrait;
2828

2929

30-
/** @var string */
31-
public const TEXTCONTENT_TYPE = NonNegativeIntegerValue::class;
30+
public const string TEXTCONTENT_TYPE = NonNegativeIntegerValue::class;
3231

3332
/** The namespace-attribute for the xs:anyAttribute element */
34-
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER;
33+
public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER;
3534

3635

3736
/**
@@ -53,7 +52,6 @@ final public function __construct(
5352
* Convert XML into a class instance
5453
*
5554
* @param \DOMElement $xml The XML element we should load
56-
* @return static
5755
*
5856
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
5957
* If the qualified name of the supplied element is wrong
@@ -71,7 +69,6 @@ public static function fromXML(DOMElement $xml): static
7169
* Convert this element to XML.
7270
*
7371
* @param \DOMElement|null $parent The element we should append this element to.
74-
* @return \DOMElement
7572
*/
7673
public function toXML(?DOMElement $parent = null): DOMElement
7774
{

src/XML/wsa_200408/AbstractServiceNameType.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ abstract class AbstractServiceNameType extends AbstractWsaElement
2828
use TypedTextContentTrait;
2929

3030

31-
/** @var string */
32-
public const TEXTCONTENT_TYPE = QNameValue::class;
31+
public const string TEXTCONTENT_TYPE = QNameValue::class;
3332

3433
/** The namespace-attribute for the xs:anyElement element */
35-
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER;
34+
public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER;
3635

3736

3837
/**
@@ -65,7 +64,6 @@ public function getPortName(): ?NCNameValue
6564
* Convert XML into a class instance
6665
*
6766
* @param \DOMElement $xml The XML element we should load
68-
* @return static
6967
*
7068
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
7169
* If the qualified name of the supplied element is wrong
@@ -87,7 +85,6 @@ public static function fromXML(DOMElement $xml): static
8785
* Convert this element to XML.
8886
*
8987
* @param \DOMElement|null $parent The element we should append this element to.
90-
* @return \DOMElement
9188
*/
9289
public function toXML(?DOMElement $parent = null): DOMElement
9390
{

src/XML/wsa_200408/AbstractWsaElement.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
*/
1515
abstract class AbstractWsaElement extends AbstractElement
1616
{
17-
/** @var string */
18-
public const NS = C::NS_ADDR_200408;
17+
public const string NS = C::NS_ADDR_200408;
1918

20-
/** @var string */
21-
public const NS_PREFIX = 'wsa';
19+
public const string NS_PREFIX = 'wsa';
2220

23-
/** @var string */
24-
public const SCHEMA = 'resources/schemas/ws-addr-200408.xsd';
21+
public const string SCHEMA = 'resources/schemas/ws-addr-200408.xsd';
2522
}

src/XML/wsa_200408/ReferenceParameters.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class ReferenceParameters extends AbstractWsaElement
2121

2222

2323
/** The namespace-attribute for the xs:any element */
24-
public const XS_ANY_ELT_NAMESPACE = NS::ANY;
24+
public const string XS_ANY_ELT_NAMESPACE = NS::ANY;
2525

2626

2727
/**
@@ -37,8 +37,6 @@ public function __construct(array $children = [])
3737

3838
/**
3939
* Test if an object, at the state it's in, would produce an empty XML-element
40-
*
41-
* @return bool
4240
*/
4341
public function isEmptyElement(): bool
4442
{
@@ -50,7 +48,6 @@ public function isEmptyElement(): bool
5048
* Convert XML into an ReferenceParameters element
5149
*
5250
* @param \DOMElement $xml The XML element we should load
53-
* @return static
5451
*
5552
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
5653
* If the qualified name of the supplied element is wrong
@@ -70,7 +67,6 @@ public static function fromXML(DOMElement $xml): static
7067
* Convert this ReferenceParameters to XML.
7168
*
7269
* @param \DOMElement|null $parent The element we should add this ReferenceParameters to.
73-
* @return \DOMElement This Header-element.
7470
*/
7571
public function toXML(?DOMElement $parent = null): DOMElement
7672
{

src/XML/wsa_200408/ReferenceProperties.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class ReferenceProperties extends AbstractWsaElement
2121

2222

2323
/** The namespace-attribute for the xs:any element */
24-
public const XS_ANY_ELT_NAMESPACE = NS::ANY;
24+
public const string XS_ANY_ELT_NAMESPACE = NS::ANY;
2525

2626

2727
/**
@@ -37,8 +37,6 @@ public function __construct(array $children = [])
3737

3838
/**
3939
* Test if an object, at the state it's in, would produce an empty XML-element
40-
*
41-
* @return bool
4240
*/
4341
public function isEmptyElement(): bool
4442
{
@@ -50,7 +48,6 @@ public function isEmptyElement(): bool
5048
* Convert XML into an ReferenceProperties element
5149
*
5250
* @param \DOMElement $xml The XML element we should load
53-
* @return static
5451
*
5552
* @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException
5653
* If the qualified name of the supplied element is wrong
@@ -70,7 +67,6 @@ public static function fromXML(DOMElement $xml): static
7067
* Convert this ReferenceProperties to XML.
7168
*
7269
* @param \DOMElement|null $parent The element we should add this ReferenceProperties to.
73-
* @return \DOMElement This Header-element.
7470
*/
7571
public function toXML(?DOMElement $parent = null): DOMElement
7672
{

0 commit comments

Comments
 (0)