Skip to content

Commit 00f101e

Browse files
committed
More refactoring
1 parent 8413b24 commit 00f101e

File tree

327 files changed

+1991
-1953
lines changed

Some content is hidden

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

327 files changed

+1991
-1953
lines changed

classes/element.registry.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,46 @@
44

55
return [
66
'http://www.w3.org/2001/XMLSchema' => [
7-
'all' => '\SimpleSAML\XMLSchema\XML\xs\All',
8-
'annotation' => '\SimpleSAML\XMLSchema\XML\xs\Annotation',
9-
'any' => '\SimpleSAML\XMLSchema\XML\xs\Any',
10-
'anyAttribute' => '\SimpleSAML\XMLSchema\XML\xs\AnyAttribute',
11-
'appinfo' => '\SimpleSAML\XMLSchema\XML\xs\Appinfo',
12-
'attribute' => '\SimpleSAML\XMLSchema\XML\xs\TopLevelAttribute',
13-
'attributeGroup' => '\SimpleSAML\XMLSchema\XML\xs\NamedAttributeGroup',
14-
'choice' => '\SimpleSAML\XMLSchema\XML\xs\Choice',
15-
'complexContent' => '\SimpleSAML\XMLSchema\XML\xs\ComplexContent',
16-
'complexType' => '\SimpleSAML\XMLSchema\XML\xs\TopLevelComplexType',
17-
'documentation' => '\SimpleSAML\XMLSchema\XML\xs\Documentation',
18-
'element' => '\SimpleSAML\XMLSchema\XML\xs\TopLevelElement',
19-
'enumeration' => '\SimpleSAML\XMLSchema\XML\xs\Enumeration',
20-
'field' => '\SimpleSAML\XMLSchema\XML\xs\Field',
21-
'fractionDigits' => '\SimpleSAML\XMLSchema\XML\xs\FractionDigits',
22-
'group' => '\SimpleSAML\XMLSchema\XML\xs\NamedGroup',
23-
'import' => '\SimpleSAML\XMLSchema\XML\xs\Import',
24-
'include' => '\SimpleSAML\XMLSchema\XML\xs\XsInclude',
25-
'key' => '\SimpleSAML\XMLSchema\XML\xs\Key',
26-
'keyref' => '\SimpleSAML\XMLSchema\XML\xs\Keyref',
27-
'length' => '\SimpleSAML\XMLSchema\XML\xs\Length',
28-
'list' => '\SimpleSAML\XMLSchema\XML\xs\XsList',
29-
'maxExclusive' => '\SimpleSAML\XMLSchema\XML\xs\MaxExclusive',
30-
'maxInclusive' => '\SimpleSAML\XMLSchema\XML\xs\MaxInclusive',
31-
'maxLength' => '\SimpleSAML\XMLSchema\XML\xs\MaxLength',
32-
'minExclusive' => '\SimpleSAML\XMLSchema\XML\xs\MinExclusive',
33-
'minInclusive' => '\SimpleSAML\XMLSchema\XML\xs\MinInclusive',
34-
'minLength' => '\SimpleSAML\XMLSchema\XML\xs\MinLength',
35-
'notation' => '\SimpleSAML\XMLSchema\XML\xs\Notation',
36-
'pattern' => '\SimpleSAML\XMLSchema\XML\xs\Pattern',
37-
'redefine' => '\SimpleSAML\XMLSchema\XML\xs\Redefine',
38-
'restriction' => '\SimpleSAML\XMLSchema\XML\xs\Restriction',
39-
'schema' => '\SimpleSAML\XMLSchema\XML\xs\Schema',
40-
'selector' => '\SimpleSAML\XMLSchema\XML\xs\Selector',
41-
'sequence' => '\SimpleSAML\XMLSchema\XML\xs\Sequence',
42-
'simpleContent' => '\SimpleSAML\XMLSchema\XML\xs\SimpleContent',
43-
'simpleType' => '\SimpleSAML\XMLSchema\XML\xs\TopLevelSimpleType',
44-
'totalDigits' => '\SimpleSAML\XMLSchema\XML\xs\TotalDigits',
45-
'union' => '\SimpleSAML\XMLSchema\XML\xs\Union',
46-
'unique' => '\SimpleSAML\XMLSchema\XML\xs\Unique',
47-
'whiteSpace' => '\SimpleSAML\XMLSchema\XML\xs\WhiteSpace',
7+
'all' => '\SimpleSAML\XMLSchema\XML\All',
8+
'annotation' => '\SimpleSAML\XMLSchema\XML\Annotation',
9+
'any' => '\SimpleSAML\XMLSchema\XML\Any',
10+
'anyAttribute' => '\SimpleSAML\XMLSchema\XML\AnyAttribute',
11+
'appinfo' => '\SimpleSAML\XMLSchema\XML\Appinfo',
12+
'attribute' => '\SimpleSAML\XMLSchema\XML\TopLevelAttribute',
13+
'attributeGroup' => '\SimpleSAML\XMLSchema\XML\NamedAttributeGroup',
14+
'choice' => '\SimpleSAML\XMLSchema\XML\Choice',
15+
'complexContent' => '\SimpleSAML\XMLSchema\XML\ComplexContent',
16+
'complexType' => '\SimpleSAML\XMLSchema\XML\TopLevelComplexType',
17+
'documentation' => '\SimpleSAML\XMLSchema\XML\Documentation',
18+
'element' => '\SimpleSAML\XMLSchema\XML\TopLevelElement',
19+
'enumeration' => '\SimpleSAML\XMLSchema\XML\Enumeration',
20+
'field' => '\SimpleSAML\XMLSchema\XML\Field',
21+
'fractionDigits' => '\SimpleSAML\XMLSchema\XML\FractionDigits',
22+
'group' => '\SimpleSAML\XMLSchema\XML\NamedGroup',
23+
'import' => '\SimpleSAML\XMLSchema\XML\Import',
24+
'include' => '\SimpleSAML\XMLSchema\XML\XsInclude',
25+
'key' => '\SimpleSAML\XMLSchema\XML\Key',
26+
'keyref' => '\SimpleSAML\XMLSchema\XML\Keyref',
27+
'length' => '\SimpleSAML\XMLSchema\XML\Length',
28+
'list' => '\SimpleSAML\XMLSchema\XML\XsList',
29+
'maxExclusive' => '\SimpleSAML\XMLSchema\XML\MaxExclusive',
30+
'maxInclusive' => '\SimpleSAML\XMLSchema\XML\MaxInclusive',
31+
'maxLength' => '\SimpleSAML\XMLSchema\XML\MaxLength',
32+
'minExclusive' => '\SimpleSAML\XMLSchema\XML\MinExclusive',
33+
'minInclusive' => '\SimpleSAML\XMLSchema\XML\MinInclusive',
34+
'minLength' => '\SimpleSAML\XMLSchema\XML\MinLength',
35+
'notation' => '\SimpleSAML\XMLSchema\XML\Notation',
36+
'pattern' => '\SimpleSAML\XMLSchema\XML\Pattern',
37+
'redefine' => '\SimpleSAML\XMLSchema\XML\Redefine',
38+
'restriction' => '\SimpleSAML\XMLSchema\XML\Restriction',
39+
'schema' => '\SimpleSAML\XMLSchema\XML\Schema',
40+
'selector' => '\SimpleSAML\XMLSchema\XML\Selector',
41+
'sequence' => '\SimpleSAML\XMLSchema\XML\Sequence',
42+
'simpleContent' => '\SimpleSAML\XMLSchema\XML\SimpleContent',
43+
'simpleType' => '\SimpleSAML\XMLSchema\XML\TopLevelSimpleType',
44+
'totalDigits' => '\SimpleSAML\XMLSchema\XML\TotalDigits',
45+
'union' => '\SimpleSAML\XMLSchema\XML\Union',
46+
'unique' => '\SimpleSAML\XMLSchema\XML\Unique',
47+
'whiteSpace' => '\SimpleSAML\XMLSchema\XML\WhiteSpace',
4848
],
4949
];

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"autoload-dev": {
2525
"psr-4": {
26-
"SimpleSAML\\Test\\XML\\": ["tests/XML", "tests/Utils"],
26+
"SimpleSAML\\Test\\Helper\\": ["tests/Helper"],
27+
"SimpleSAML\\Test\\XML\\": ["tests/XML"],
2728
"SimpleSAML\\Test\\XMLSchema\\": ["tests/XMLSchema"]
2829
}
2930
},

src/XML/AbstractElement.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use SimpleSAML\XML\Assert\Assert;
1010
use SimpleSAML\XML\SerializableElementTrait;
1111
use SimpleSAML\XMLSchema\Exception\{MissingAttributeException, SchemaViolationException};
12-
use SimpleSAML\XMLSchema\Type\Builtin\{QNameValue, StringValue};
13-
use SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface;
12+
use SimpleSAML\XMLSchema\Type\{QNameValue, StringValue};
13+
use SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface;
1414

1515
use function array_slice;
1616
use function defined;
@@ -55,7 +55,7 @@ public function instantiateParentElement(?DOMElement $parent = null): DOMElement
5555

5656

5757
/**
58-
* @template T of \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface
58+
* @template T of \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface
5959
* @param \DOMElement $xml The element where we should search for the attribute.
6060
* @param string $name The name of the attribute.
6161
* @param class-string<T> $type The type of the attribute value.
@@ -87,13 +87,13 @@ public static function getAttribute(
8787
/**
8888
* Get the value of an attribute from a given element.
8989
*
90-
* @template T of \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface
90+
* @template T of \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface
9191
* @param \DOMElement $xml The element where we should search for the attribute.
9292
* @param string $name The name of the attribute.
9393
* @param class-string<T> $type The type of the attribute value.
94-
* @param \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface|null $default
94+
* @param \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface|null $default
9595
* The default to return in case the attribute does not exist and it is optional.
96-
* @return ($default is \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface ? T : T|null)
96+
* @return ($default is \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface ? T : T|null)
9797
*/
9898
public static function getOptionalAttribute(
9999
DOMElement $xml,

src/XML/Attribute.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use DOMAttr;
88
use DOMElement;
99
use SimpleSAML\XML\Assert\Assert;
10-
use SimpleSAML\XMLSchema\Type\Builtin\StringValue;
11-
use SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface;
10+
use SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface;
11+
use SimpleSAML\XMLSchema\Type\StringValue;
1212

1313
use function array_keys;
1414
use function strval;
@@ -26,7 +26,7 @@ final class Attribute implements ArrayizableElementInterface
2626
* @param string|null $namespaceURI
2727
* @param string|null $namespacePrefix
2828
* @param string $attrName
29-
* @param \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface $attrValue
29+
* @param \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface $attrValue
3030
*/
3131
public function __construct(
3232
protected ?string $namespaceURI,
@@ -78,7 +78,7 @@ public function getAttrName(): string
7878
/**
7979
* Collect the value of the value-property
8080
*
81-
* @return \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface
81+
* @return \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface
8282
*/
8383
public function getAttrValue(): ValueTypeInterface
8484
{
@@ -134,7 +134,7 @@ public function toXML(DOMElement $parent): DOMElement
134134
* namespaceURI: string,
135135
* namespacePrefix: string|null,
136136
* attrName: string,
137-
* attrValue: \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface,
137+
* attrValue: \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface,
138138
* } $data
139139
* @return static
140140
*/

src/XML/Chunk.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use SimpleSAML\XML\DOMDocumentFactory;
1010
use SimpleSAML\XML\SerializableElementTrait;
1111
use SimpleSAML\XMLSchema\Exception\{MissingAttributeException, SchemaViolationException};
12-
use SimpleSAML\XMLSchema\Type\Builtin\StringValue;
13-
use SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface;
12+
use SimpleSAML\XMLSchema\Type\StringValue;
13+
use SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface;
1414

1515
/**
1616
* Serializable class used to hold an XML element.
@@ -159,7 +159,7 @@ public function getQualifiedName(): string
159159
/**
160160
* Get the value of an attribute from a given element.
161161
*
162-
* @template T of \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface
162+
* @template T of \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface
163163
* @param \DOMElement $xml The element where we should search for the attribute.
164164
* @param string $name The name of the attribute.
165165
* @param class-string<T> $type The type of the attribute value.
@@ -188,13 +188,13 @@ public static function getAttribute(
188188
/**
189189
* Get the value of an attribute from a given element.
190190
*
191-
* @template T of \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface
191+
* @template T of \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface
192192
* @param \DOMElement $xml The element where we should search for the attribute.
193193
* @param string $name The name of the attribute.
194194
* @param class-string<T> $type The type of the attribute value.
195-
* @param \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface|null $default
195+
* @param \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface|null $default
196196
* The default to return in case the attribute does not exist and it is optional.
197-
* @return ($default is \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface ? T : T|null)
197+
* @return ($default is \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface ? T : T|null)
198198
*/
199199
public static function getOptionalAttribute(
200200
DOMElement $xml,

src/XML/ElementInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace SimpleSAML\XML;
66

77
use DOMElement;
8-
use SimpleSAML\XMLSchema\Type\Builtin\StringValue;
9-
use SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface;
8+
use SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface;
9+
use SimpleSAML\XMLSchema\Type\StringValue;
1010

1111
/**
1212
* interface class to be implemented by all the classes that represent an XML element
@@ -29,7 +29,7 @@ public function getQualifiedName(): string;
2929
* @param \DOMElement $xml The element where we should search for the attribute.
3030
* @param string $name The name of the attribute.
3131
* @param string $type The type of the attribute value
32-
* @return \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface
32+
* @return \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface
3333
*
3434
* @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException if the attribute is missing from the element
3535
*/
@@ -46,9 +46,9 @@ public static function getAttribute(
4646
* @param \DOMElement $xml The element where we should search for the attribute.
4747
* @param string $name The name of the attribute.
4848
* @param string $type The type of the attribute value
49-
* @param \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface|null $default
49+
* @param \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface|null $default
5050
* The default to return in case the attribute does not exist and it is optional.
51-
* @return \SimpleSAML\XMLSchema\Type\Helper\ValueTypeInterface|null
51+
* @return \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface|null
5252
*/
5353
public static function getOptionalAttribute(
5454
DOMElement $xml,

src/XML/ExtendableAttributesTrait.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use SimpleSAML\XML\Assert\Assert;
1010
use SimpleSAML\XML\Attribute;
1111
use SimpleSAML\XML\Constants as C;
12-
use SimpleSAML\XMLSchema\Type\Builtin\StringValue;
13-
use SimpleSAML\XMLSchema\XML\xs\NamespaceEnum;
12+
use SimpleSAML\XMLSchema\Type\StringValue;
13+
use SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum;
1414

1515
use function array_diff;
1616
use function array_map;
@@ -91,8 +91,8 @@ public function getAttributesNS(): array
9191
*
9292
* @param \DOMElement $xml
9393
* @param (
94-
* \SimpleSAML\XMLSchema\XML\xs\NamespaceEnum|
95-
* array<\SimpleSAML\XMLSchema\XML\xs\NamespaceEnum|string>|
94+
* \SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum|
95+
* array<\SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum|string>|
9696
* null
9797
* ) $namespace
9898
*
@@ -255,7 +255,10 @@ function (Attribute $attr) {
255255

256256

257257
/**
258-
* @return array<\SimpleSAML\XMLSchema\XML\xs\NamespaceEnum|string>|\SimpleSAML\XMLSchema\XML\xs\NamespaceEnum
258+
* @return (
259+
* array<\SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum|string>|
260+
* \SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum
261+
* )[]
259262
*/
260263
public function getAttributeNamespace(): array|NamespaceEnum
261264
{

src/XML/ExtendableElementTrait.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use SimpleSAML\XML\Chunk;
1111
use SimpleSAML\XML\Constants as C;
1212
use SimpleSAML\XML\Registry\ElementRegistry;
13-
use SimpleSAML\XMLSchema\XML\xs\NamespaceEnum;
13+
use SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum;
1414

1515
use function array_diff;
1616
use function array_map;
@@ -39,8 +39,8 @@ trait ExtendableElementTrait
3939
*
4040
* @param \DOMElement $xml
4141
* @param (
42-
* \SimpleSAML\XMLSchema\XML\xs\NamespaceEnum|
43-
* array<\SimpleSAML\XMLSchema\XML\xs\NamespaceEnum|string>|
42+
* \SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum|
43+
* array<\SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum|string>|
4444
* null
4545
* ) $namespace
4646
*
@@ -206,7 +206,10 @@ public function getElements(): array
206206

207207

208208
/**
209-
* @return array<\SimpleSAML\XMLSchema\XML\xs\NamespaceEnum|string>|\SimpleSAML\XMLSchema\XML\xs\NamespaceEnum
209+
* @return (
210+
* array<\SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum|string>|
211+
* \SimpleSAML\XMLSchema\XML\Enumeration\NamespaceEnum
212+
* )
210213
*/
211214
public function getElementNamespace(): array|NamespaceEnum
212215
{

src/XML/Type/BaseValue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
use SimpleSAML\XML\Attribute;
88
use SimpleSAML\XML\Constants as C;
9-
use SimpleSAML\XMLSchema\Type\Builtin\AnyURIValue;
10-
use SimpleSAML\XMLSchema\Type\Helper\AttributeTypeInterface;
9+
use SimpleSAML\XMLSchema\Type\AnyURIValue;
10+
use SimpleSAML\XMLSchema\Type\Interface\AttributeTypeInterface;
1111

1212
/**
1313
* @package simplesaml/xml-common

src/XML/Type/IDValue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
use SimpleSAML\XML\Attribute;
88
use SimpleSAML\XML\Constants as C;
9-
use SimpleSAML\XMLSchema\Type\Builtin\IDValue as BaseIDValue;
10-
use SimpleSAML\XMLSchema\Type\Helper\AttributeTypeInterface;
9+
use SimpleSAML\XMLSchema\Type\IDValue as BaseIDValue;
10+
use SimpleSAML\XMLSchema\Type\Interface\AttributeTypeInterface;
1111

1212
/**
1313
* @package simplesaml/xml-common

0 commit comments

Comments
 (0)