Skip to content

Commit 951fd67

Browse files
authored
Merge pull request #15 from veewee/upgrade/veewee-xml-v4
Upgrade to veewee/xml v4 with PHP 8.4+ minimum
2 parents c7f7026 + fb09f75 commit 951fd67

File tree

17 files changed

+52
-55
lines changed

17 files changed

+52
-55
lines changed

.github/workflows/analyzers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
operating-system: [ubuntu-latest]
10-
php-versions: ['8.3', '8.4', '8.5']
10+
php-versions: ['8.4', '8.5']
1111
composer-options: ['--ignore-platform-req=php+']
1212
fail-fast: false
1313
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}

.github/workflows/code-style.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
operating-system: [ubuntu-latest]
10-
php-versions: ['8.3', '8.4', '8.5']
10+
php-versions: ['8.4', '8.5']
1111
composer-options: ['--ignore-platform-req=php+']
1212
fail-fast: false
1313
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
operating-system: [ubuntu-latest]
10-
php-versions: ['8.3', '8.4', '8.5']
10+
php-versions: ['8.4', '8.5']
1111
composer-options: ['--ignore-platform-req=php+']
1212
fail-fast: false
1313
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
}
2121
],
2222
"require": {
23-
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
23+
"php": "~8.4.0 || ~8.5.0",
2424
"ext-dom": "*",
25-
"veewee/xml": "^3.4"
25+
"php-standard-library/dict": "^6.1",
26+
"php-standard-library/foundation": "^6.1",
27+
"veewee/xml": "^4.8"
2628
},
2729
"require-dev": {
2830
"phpunit/phpunit": "~12.3",

psalm.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errorLevel="1"
44
resolveFromConfigFile="true"
55
strictBinaryOperands="true"
6-
phpVersion="8.0"
6+
phpVersion="8.4"
77
allowStringToStandInForClass="true"
88
rememberPropertyAssignmentsAfterCall="false"
99
skipChecksOnUnresolvableIncludes="false"
@@ -22,6 +22,9 @@
2222
<directory name="tests" />
2323
</ignoreFiles>
2424
</projectFiles>
25+
<stubs>
26+
<file name="vendor/veewee/xml/stubs/DOM.phpstub" />
27+
</stubs>
2528
<ignoreExceptions>
2629
<class name="InvalidArgumentException" />
2730
</ignoreExceptions>

src/Builder/Header/Actor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Soap\Xml\Builder\Header;
55

6-
use DOMNode;
6+
use Dom\Node;
77
use VeeWee\Xml\Dom\Builder\Builder;
88
use VeeWee\Xml\Exception\RuntimeException;
99
use function VeeWee\Xml\Dom\Builder\namespaced_attribute;
@@ -26,7 +26,7 @@ public static function next(): self
2626
/**
2727
* @psalm-suppress MissingThrowsDocblock
2828
*/
29-
public function __invoke(DOMNode $node): DOMNode
29+
public function __invoke(Node $node): Node
3030
{
3131
$document = detect_document($node);
3232
$namespace = root_namespace_uri()($document) ?? '';

src/Builder/Header/MustUnderstand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Soap\Xml\Builder\Header;
55

6-
use DOMNode;
6+
use Dom\Node;
77
use VeeWee\Xml\Dom\Builder\Builder;
88
use VeeWee\Xml\Exception\RuntimeException;
99
use function VeeWee\Xml\Dom\Builder\namespaced_attribute;
@@ -16,7 +16,7 @@ final class MustUnderstand implements Builder
1616
/**
1717
* @psalm-suppress MissingThrowsDocblock
1818
*/
19-
public function __invoke(DOMNode $node): DOMNode
19+
public function __invoke(Node $node): Node
2020
{
2121
$document = detect_document($node);
2222
$namespace = root_namespace_uri()($document) ?? '';

src/Builder/SoapHeader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
namespace Soap\Xml\Builder;
55

6-
use DOMElement;
7-
use DOMNode;
6+
use Dom\Element;
7+
use Dom\Node;
88
use VeeWee\Xml\Dom\Builder\Builder;
99
use function VeeWee\Xml\Dom\Builder\children;
1010
use function VeeWee\Xml\Dom\Builder\namespaced_element;
1111

1212
final class SoapHeader implements Builder
1313
{
1414
/**
15-
* @var list<callable(DOMNode): DOMElement>
15+
* @var list<callable(Node): Element>
1616
*/
1717
private array $configurators;
1818

1919
/**
2020
* @no-named-arguments
21-
* @param list<callable(DOMNode): DOMElement> $configurators
21+
* @param list<callable(Node): Element> $configurators
2222
*/
2323
public function __construct(
2424
private string $namespace,
@@ -31,7 +31,7 @@ public function __construct(
3131
/**
3232
* @psalm-suppress MissingThrowsDocblock
3333
*/
34-
public function __invoke(DOMNode $node): DOMNode
34+
public function __invoke(Node $node): Node
3535
{
3636
return children(
3737
namespaced_element(

src/Builder/SoapHeaders.php

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

33
namespace Soap\Xml\Builder;
44

5-
use DOMElement;
6-
use DOMNode;
5+
use Dom\Element;
6+
use Dom\Node;
77
use VeeWee\Xml\Dom\Builder\Builder;
88
use function VeeWee\Xml\Dom\Builder\namespaced_element;
99
use function VeeWee\Xml\Dom\Locator\Node\detect_document;
@@ -12,13 +12,13 @@
1212
final class SoapHeaders implements Builder
1313
{
1414
/**
15-
* @var list<callable(DOMNode): DOMElement>
15+
* @var list<callable(Node): Element>
1616
*/
1717
private array $configurators;
1818

1919
/**
2020
* @no-named-arguments
21-
* @param list<callable(DOMNode): DOMElement> $configurators
21+
* @param list<callable(Node): Element> $configurators
2222
*/
2323
public function __construct(callable ... $configurators)
2424
{
@@ -28,7 +28,7 @@ public function __construct(callable ... $configurators)
2828
/**
2929
* @psalm-suppress MissingThrowsDocblock
3030
*/
31-
public function __invoke(DOMNode $node): DOMNode
31+
public function __invoke(Node $node): Node
3232
{
3333
$document = detect_document($node);
3434

src/Locator/BodyNamespaceLocator.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@
44

55
namespace Soap\Xml\Locator;
66

7-
use DOMDocument;
7+
use Dom\XMLDocument;
88
use VeeWee\Xml\Exception\RuntimeException;
99

1010
final class BodyNamespaceLocator
1111
{
1212
/**
13-
* @psalm-suppress UndefinedPropertyFetch - psalm gets lost
14-
* @psalm-suppress MixedReturnStatement - psalm gets lost
15-
* @psalm-suppress MixedPropertyFetch - psalm gets lost
16-
* @psalm-suppress MixedInferredReturnType - psalm gets lost
1713
* @throws RuntimeException
1814
*/
19-
public function __invoke(DOMDocument $document): ?string
15+
public function __invoke(XMLDocument $document): ?string
2016
{
2117
return (new SoapBodyLocator())($document)?->firstElementChild?->namespaceURI;
2218
}

0 commit comments

Comments
 (0)