Releases: phpro/soap-client
Version 3.1.2
What's Changed
- Allow empty enums by @veewee in #507
- Avoid normalizing void => void because this causes class generation errors by @veewee in #507
Full Changelog: 3.1.1...3.1.2
Version 3.1.1
Version 3.1.0
Release 3.0.0
In a time of static analyzers, we needed to step up our game and make the code generation as type-safe as possible!
This release aims to provide a solution for all type-related issues you might have encountered in previous versions.
It provides improved support for:
- Reading, understanding and humanizing WSDL files
- nullable / occurs / ...
- extends / abstract types
- enums
- union types
- composed simple types
- nested simple types
- Check out the full list of improvements here
This example generated type-class gives you an idea:
namespace OurSoapClient\Type;
use IteratorAggregate;
/**
* @phpstan-implements \IteratorAggregate<int<1,max>, \OurSoapClient\Type\Description>
* @psalm-implements \IteratorAggregate<int<1,max>, \OurSoapClient\Type\Description>
*/
class Descriptions implements IteratorAggregate
{
/**
* @var array<int<1,max>, \OurSoapClient\Type\Description>
*/
private array $Description;
/**
* @return \ArrayIterator|\OurSoapClient\Type\Description[]
* @phpstan-return \ArrayIterator<int<1,max>, \OurSoapClient\Type\Description>
* @psalm-return \ArrayIterator<int<1,max>, \OurSoapClient\Type\Description>
*/
public function getIterator() : \ArrayIterator
{
return new \ArrayIterator($this->Description);
}
}
The result of the generated code is fully understandable by your static analyzer tools !!!
Upgrading
composer require 'phpro/soap-client:^3.0.0' --update-with-dependencies
Upgrading is a matter of changing the engine for code generation in the code-generation configuration file:
use Phpro\SoapClient\Soap\CodeGeneratorEngineFactory;
use Soap\Wsdl\Loader\FlatteningLoader;
use Soap\Wsdl\Loader\StreamWrapperLoader;
return Config::create()
->setEngine($engine = CodeGeneratorEngineFactory::create(
'your.wsdl',
new FlatteningLoader(new StreamWrapperLoader()) // Or a PSR18-based loader ... :)
))
Note: You can still use the default engine, yet you won't get the information for the enhanced type generation.
Regenerate classes:
./vendor/bin/soap-client generate:client --config=config/soap-client.php
./vendor/bin/soap-client generate:classmap --config=config/soap-client.php
./vendor/bin/soap-client generate:types --config=config/soap-client.php
Show us your love 💚
At the moment, we baked a bit more than 10% of the initial goal of this project. Meaning a lot of personal time went into the project.
Just to give an idea: This release is massive and consists out about 2,5 years of periodically working on and off the new features.
If you like what we did with the project, we appreciate any sponsorships.
This way, we can make some more time for working on the next big encoder / decoder improvement project.
What's Changed
- The https://github.com/php-soap/wsdl-reader project was born to feed our code generator.
- Prepare code for new wsdl-reader by @veewee in #463
- Generated constructor is descripbed by @param instead of @var. by @h4kuna in #468
- Improve method and type generation on simple types by @veewee in #470
- Add support for inheritance based on WSDL metadata by @veewee in #471
- Add static analysis support for enumerations by @veewee in #472
- Add support for union types by @veewee in #473
- Allow newer version of laminas/laminas-code by @lkck24 in #476
- Allow properties and getters to be marked as nullable from codegenertion by @veewee in #480
- Make the CodeGenerationEngine more configurable by @veewee in #481
- Code generation improvements by @veewee in #482
- Add common naming conventions for property methods (getters, setters,…) by @veewee in #484
- Add missing case for _ normalizations by @veewee in #486
- Improve error message during type generation by @veewee in #487
- Move helper functions over to wsdl-reader by @veewee in #488
New Contributors
Full Changelog: 2.4.0...3.0.0
Version 2.4.2
Version 2.4.1
3.0.0 - Alpha 1
❗ This pre-release is highly experimental ❗
It aims to add stricter and better types to the generated codebase.
Therefore, it uses a new wsdl-reader package.
We decided to pre-launch at this point in order to get some feedback from you.
Feel free to play around with it and give us feedback!
But first, check out this awesomely types example output:
namespace OurSoapClient\Type;
use IteratorAggregate;
/**
* @phpstan-implements \IteratorAggregate<int<1,max>, \OurSoapClient\Type\Description>
* @psalm-implements \IteratorAggregate<int<1,max>, \OurSoapClient\Type\Description>
*/
class Descriptions implements IteratorAggregate
{
/**
* @var array<int<1,max>, \OurSoapClient\Type\Description>
*/
private array $Description;
/**
* @return \ArrayIterator|\OurSoapClient\Type\Description[]
* @phpstan-return \ArrayIterator<int<1,max>, \OurSoapClient\Type\Description>
* @psalm-return \ArrayIterator<int<1,max>, \OurSoapClient\Type\Description>
*/
public function getIterator() : \ArrayIterator
{
return new \ArrayIterator($this->Description);
}
}
Upgrading
composer require 'phpro/soap-client:^3.0.0-alpha1@alpha' --update-with-dependencies
Upgrading is a matter of changing the engine for code generation in the code-generation configuration file:
use Phpro\SoapClient\Soap\CodeGeneratorEngineFactory;
use Soap\Wsdl\Loader\FlatteningLoader;
use Soap\Wsdl\Loader\StreamWrapperLoader;
return Config::create()
->setEngine($engine = CodeGeneratorEngineFactory::create(
'your.wsdl',
new FlatteningLoader(new StreamWrapperLoader()) // Or a PSR18-based loader ... :)
))
You should be able to rebuild your types by removing the old files and regenerating them:
php ./vendor/bin/soap-client generate:client --config=config/xxxx.php
php ./vendor/bin/soap-client generate:classmap --config=config/xxxx.php
php ./vendor/bin/soap-client generate:types --config=config/xxxx.php
Questions
Join the discussion and provide your feedback here!
Can it parse your WSDL?
- If so, is it correct or does it lack information?
- If not, feel free to share your WSDL by opening up an issue. (If your WSDL cannot be publically distributed - you can send us in all confidence or you can try to extract the problem-part from it)
ℹ️ You could use the wsdl-reader CLI tools to introspect all the information that is being read from your WSDL
How strict should we enforce the types by default?
We've configured the default settings to enforce strict types on all your properties, methods, ... You'dd expect the information from the SOAP server to match the WSDL signature, but this is not always true. This might make it annoying for new users of this package to overcome this kind of errors. so:
- Should we enforce very strict type rules by default and let you opt-out?
- Should we only set strict docblock types and let you opt-in on the very strict PHP types?
- Another approach maybe?
Any other feedback is welcome as well!
Feel free to hop on the discussion!
Roadmap for stable release
There is still a lot of work we want to get done in order to get to a stable release.
Check #464 for the complete roadmap.
Want to help out? 💚
At the moment, we only baked 5% of the development time of this project.
Feel free to help out by sponsoring, so that we can make some more time for this.
Release 2.4.0
What's Changed
- Improve ValidatorSubscriber error messages by including property path. by @ademarco in #456
- IsRequestRule and IsResponseRule are now compatible with PropertyContext by @boraneksenphpro in #460
New Contributors
- @ademarco made their first contribution in #456
- @boraneksenphpro made their first contribution in #460
Full Changelog: 2.3.0...2.4.0
Release 2.3.0
What's Changed
- Fix typo in readme.md by @borisson in #441
- StrictTypesAssember by @janvernieuwe in #450
- Add PHP82 + PSL2 Support by @veewee in #454
New Contributors
Full Changelog: v2.2.1...2.3.0
Version 2.2.1
What's Changed
- Allow all currently available versions of psr/log by @rimas-kudelis in #430
Full Changelog: v2.2.0...v2.2.1