Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/analyzers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '8.4', '8.5' ]
composer-options: [ '--ignore-platform-req=php+' ]
php-versions: ['8.4', '8.5', '8.6']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand All @@ -21,7 +20,6 @@ jobs:
tools: 'composer:v2'
extensions: pcov, mbstring, posix, dom, soap
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
run: composer update --prefer-dist --no-progress --no-suggest
- name: Run the tests
run: ./vendor/bin/psalm --no-cache
continue-on-error: ${{ matrix.php-versions == '8.5' }}
5 changes: 2 additions & 3 deletions .github/workflows/code-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '8.4', '8.5' ]
composer-options: [ '--ignore-platform-req=php+' ]
php-versions: ['8.4', '8.5', '8.6']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand All @@ -21,6 +20,6 @@ jobs:
tools: 'composer:v2'
extensions: pcov, mbstring, posix, dom, soap
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
run: composer update --prefer-dist --no-progress --no-suggest
- name: Run the tests
run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run --diff
5 changes: 2 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '8.4', '8.5' ]
composer-options: [ '--ignore-platform-req=php+' ]
php-versions: ['8.4', '8.5', '8.6']
dependency-preference: ['current', 'lowest', 'stable']
fail-fast: false
name: PHP ${{ matrix.php-versions }} ${{ matrix.dependency-preference }} deps @ ${{ matrix.operating-system }}
Expand All @@ -22,6 +21,6 @@ jobs:
tools: 'composer:v2'
extensions: pcov, mbstring, posix, dom, soap
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.dependency-preference == 'lowest' && '--prefer-lowest' || '' }} ${{ matrix.dependency-preference == 'stable' && '--prefer-stable' || '' }} ${{ matrix.composer-options }}
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.dependency-preference == 'lowest' && '--prefer-lowest' || '' }} ${{ matrix.dependency-preference == 'stable' && '--prefer-stable' || '' }}
- name: Run the tests
run: ./vendor/bin/phpunit
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
],
"require": {
"php": "~8.4.0 || ~8.5.0",
"php": "~8.4.0 || ~8.5.0 || ~8.6.0",
"php-standard-library/collection": "^6.1",
"php-standard-library/dict": "^6.1",
"php-standard-library/encoding": "^6.1",
Expand All @@ -39,14 +39,14 @@
"php-soap/engine": "^2.21",
"php-soap/wsdl": "^1.19",
"php-soap/xml": "^1.10",
"php-soap/wsdl-reader": "~0.34"
"php-soap/wsdl-reader": "~0.35"
},
"require-dev": {
"vimeo/psalm": "~6.13",
"phpunit/phpunit": "~12.4",
"php-cs-fixer/shim": "~3.88",
"vimeo/psalm": "^7.12",
"phpunit/phpunit": "^12.4",
"php-cs-fixer/shim": "^3.88",
"symfony/var-dumper": "^7.0 || ^6.4 || ^8.0",
"php-standard-library/psalm-plugin": "^2.3",
"php-standard-library/psalm-plugin": "^2.5",
"php-soap/engine-integration-tests": "^1.12",
"php-soap/psr18-transport": "^2.0",
"guzzlehttp/guzzle": "^7.8 || ^8.0",
Expand Down
3 changes: 2 additions & 1 deletion src/Encoder/MatchingValueEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ private function to(Context $context, mixed $value): string
default => [$matchedEncoderInfo[0], $matchedEncoderInfo[1] ?? $this->defaultEncoder],
};

/** @psalm-suppress RedundantConditionGivenDocblockType - This gives better feedback to people using this encoder */
// Ensure that the encoderDetector returns valid data.
/** @psalm-suppress RedundantConditionGivenDocblockType - This gives better feedback to people using this encoder */
invariant($context instanceof Context, 'The MatchingValueEncoder::$encoderDetector callable must return a Context or an array with a Context as first element.');
/** @psalm-suppress RedundantConditionGivenDocblockType - This gives better feedback to people using this encoder */
invariant($encoder instanceof XmlEncoder, 'The MatchingValueEncoder::$encoderDetector callable must return a Context or an array with a Context as first element and an optional XmlEncoder as second element.');

return $encoder->iso($context)->to($value);
Expand Down
7 changes: 3 additions & 4 deletions src/Encoder/ObjectEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Soap\Encoding\Xml\Writer\XsdTypeXmlElementWriter;
use Soap\Encoding\Xml\Writer\XsiAttributeBuilder;
use VeeWee\Reflecta\Iso\Iso;
use function is_array;
use function is_object;
use function Psl\Fun\lazy;
use function VeeWee\Reflecta\Iso\object_data;
use function VeeWee\Reflecta\Reflect\property_is_initialized;
Expand All @@ -20,7 +20,7 @@
use function VeeWee\Xml\Writer\Builder\value as buildValue;

/**
* @template TObj extends object
* @template TObj of object
*
* @implements XmlEncoder<TObj|array, TObj, non-empty-string, Element|non-empty-string>
*/
Expand Down Expand Up @@ -70,8 +70,7 @@ function (string|Element $value) use ($context, $objectAccess) : object {
*/
private function to(Context $context, ObjectAccess $objectAccess, object|array $data): string
{
/** @var object $data */
$data = is_array($data) ? (object) $data : $data;
$data = is_object($data) ? $data : (object) $data;
$defaultAction = writeChildren([]);

$children = [
Expand Down
2 changes: 1 addition & 1 deletion src/EncoderRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static function default(): self
),

// Apache Map
$qNameFormatter(ApacheMapDetector::NAMESPACE, 'Map') => new SoapEnc\ApacheMapEncoder(),
$qNameFormatter(ApacheMapDetector::NAMESPACE_URI, 'Map') => new SoapEnc\ApacheMapEncoder(),

// Special XSD cases
$qNameFormatter($xsd, 'any') => new AnyElementEncoder(),
Expand Down
Loading