Skip to content

Commit ddb611e

Browse files
authored
Merge pull request #40 from veewee/php-85-upgrade
Upgrade project to PHP 8.5
2 parents fdc265c + 3135f94 commit ddb611e

26 files changed

+78
-99
lines changed

.github/workflows/analyzers.yaml

Lines changed: 3 additions & 2 deletions
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.2', '8.3' ]
10+
php-versions: [ '8.3', '8.4', '8.5' ]
1111
composer-options: [ '--ignore-platform-req=php+' ]
1212
fail-fast: false
1313
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
@@ -23,4 +23,5 @@ jobs:
2323
- name: Install dependencies
2424
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
2525
- name: Run the tests
26-
run: ./vendor/bin/psalm
26+
run: ./vendor/bin/psalm --no-cache
27+
continue-on-error: ${{ matrix.php-versions == '8.5' }}

.github/workflows/code-style.yaml

Lines changed: 2 additions & 2 deletions
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.2', '8.3', '8.4' ]
10+
php-versions: [ '8.3', '8.4', '8.5' ]
1111
composer-options: [ '--ignore-platform-req=php+' ]
1212
fail-fast: false
1313
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
@@ -23,4 +23,4 @@ jobs:
2323
- name: Install dependencies
2424
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
2525
- name: Run the tests
26-
run: PHP_CS_FIXER_IGNORE_ENV=1 ./tools/php-cs-fixer.phar fix --dry-run --diff
26+
run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run --diff

.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.2', '8.3', '8.4' ]
10+
php-versions: [ '8.3', '8.4', '8.5' ]
1111
composer-options: [ '--ignore-platform-req=php+' ]
1212
dependency-preference: ['current', 'lowest', 'stable']
1313
fail-fast: false

.phive/phars.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

composer.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,23 @@
2020
}
2121
],
2222
"require": {
23-
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
24-
"azjezz/psl": "^3.0",
23+
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
24+
"azjezz/psl": "^3.0 || ^4.0",
2525
"veewee/reflecta": "~0.11",
2626
"veewee/xml": "^3.3",
27-
"php-soap/engine": "^2.14",
28-
"php-soap/wsdl": "^1.12",
29-
"php-soap/xml": "^1.8",
30-
"php-soap/wsdl-reader": "~0.26"
27+
"php-soap/engine": "^2.16",
28+
"php-soap/wsdl": "^1.14",
29+
"php-soap/xml": "^1.9",
30+
"php-soap/wsdl-reader": "^0.27"
3131
},
3232
"require-dev": {
33-
"vimeo/psalm": "^5.26",
34-
"phpunit/phpunit": "^10.5",
33+
"vimeo/psalm": "~6.13",
34+
"phpunit/phpunit": "~12.4",
35+
"php-cs-fixer/shim": "~3.88",
3536
"symfony/var-dumper": "^7.0 || ^6.4",
3637
"php-standard-library/psalm-plugin": "^2.3",
37-
"php-soap/engine-integration-tests": "^1.9",
38-
"php-soap/psr18-transport": "^1.7",
38+
"php-soap/engine-integration-tests": "^1.10",
39+
"php-soap/psr18-transport": "^1.8",
3940
"guzzlehttp/guzzle": "^7.8"
4041
},
4142
"config": {

phpunit.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
cacheDirectory=".phpunit.cache"
66
executionOrder="depends,defects"
77
requireCoverageMetadata="true"
88
beStrictAboutCoverageMetadata="false"
99
beStrictAboutOutputDuringTests="true"
1010
displayDetailsOnTestsThatTriggerDeprecations="true"
11+
displayDetailsOnTestsThatTriggerWarnings="true"
1112
failOnRisky="true"
12-
failOnWarning="true">
13+
failOnWarning="true"
14+
failOnPhpunitWarning="true">
1315
<testsuites>
1416
<testsuite name="integration">
1517
<directory>tests/Integration</directory>

psalm.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
88
findUnusedBaselineEntry="true"
9-
findUnusedCode="true"
9+
findUnusedCode="false"
10+
ensureOverrideAttribute="false"
1011
>
1112
<projectFiles>
1213
<directory name="src"/>
@@ -18,11 +19,4 @@
1819
<pluginClass class="Psl\Psalm\Plugin"/>
1920
<pluginClass class="VeeWee\Reflecta\Psalm\Plugin"/>
2021
</plugins>
21-
<issueHandlers>
22-
<PossiblyUnusedMethod>
23-
<errorLevel type="suppress">
24-
<directory name="src"/>
25-
</errorLevel>
26-
</PossiblyUnusedMethod>
27-
</issueHandlers>
2822
</psalm>

src/Encoder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public function encode(string $method, array $arguments): SoapRequest
2626
$methodInfo = $this->metadata->getMethods()->fetchByName($method);
2727
$meta = $methodInfo->getMeta();
2828
$methodContext = new MethodContext($methodInfo, $this->metadata, $this->registry, $this->namespaces);
29-
$soapVersion = $meta->soapVersion()->map(SoapVersion::from(...))->unwrapOr(SoapVersion::SOAP_12);
29+
$soapVersion = $meta->soapVersion()
30+
->map(static fn ($version) => SoapVersion::from($version))
31+
->unwrapOr(SoapVersion::SOAP_12);
3032
$iso = (new RequestEncoder())->iso($methodContext);
3133

3234
return new SoapRequest(

src/Encoder/Method/RequestEncoder.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public function iso(MethodContext $context): Iso
3030
{
3131
$meta = $context->method->getMeta();
3232
$context = $context->withBindingUse(
33-
$meta->inputBindingUsage()->map(BindingUse::from(...))->unwrapOr(BindingUse::LITERAL)
33+
$meta->inputBindingUsage()
34+
->map(static fn ($value) => BindingUse::from($value))
35+
->unwrapOr(BindingUse::LITERAL)
3436
);
3537

3638
/** @var Iso<list<mixed>, non-empty-string> */
@@ -57,8 +59,11 @@ private function encode(MethodContext $context, array $arguments): string
5759
{
5860
$method = $context->method;
5961
$meta = $method->getMeta();
60-
$soapVersion = $meta->soapVersion()->map(SoapVersion::from(...))->unwrapOr(SoapVersion::SOAP_12);
61-
$encodingStyle = $meta->inputEncodingStyle()->map(EncodingStyle::from(...));
62+
$soapVersion = $meta->soapVersion()
63+
->map(static fn ($value) => SoapVersion::from($value))
64+
->unwrapOr(SoapVersion::SOAP_12);
65+
$encodingStyle = $meta->inputEncodingStyle()
66+
->map(static fn ($value) => EncodingStyle::from($value));
6267

6368
$requestParams = map_with_key(
6469
$method->getParameters(),

src/Encoder/Method/ResponseEncoder.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public function iso(MethodContext $context): Iso
2828
{
2929
$meta = $context->method->getMeta();
3030
$context = $context->withBindingUse(
31-
$meta->outputBindingUsage()->map(BindingUse::from(...))->unwrapOr(BindingUse::LITERAL)
31+
$meta->outputBindingUsage()
32+
->map(static fn ($value) => BindingUse::from($value))
33+
->unwrapOr(BindingUse::LITERAL)
3234
);
3335

3436
/** @var Iso<list<mixed>, string> */
@@ -56,8 +58,11 @@ private function encode(MethodContext $context, array $arguments): string
5658
return '';
5759
}
5860

59-
$soapVersion = $meta->soapVersion()->map(SoapVersion::from(...))->unwrapOr(SoapVersion::SOAP_12);
60-
$encodingStyle = $meta->outputEncodingStyle()->map(EncodingStyle::from(...));
61+
$soapVersion = $meta->soapVersion()
62+
->map(static fn ($value) => SoapVersion::from($value))
63+
->unwrapOr(SoapVersion::SOAP_12);
64+
$encodingStyle = $meta->outputEncodingStyle()
65+
->map(static fn ($value) => EncodingStyle::from($value));
6166

6267
$returnType = $method->getReturnType();
6368
$typeContext = $context->createXmlEncoderContextForType($returnType);

0 commit comments

Comments
 (0)