Skip to content

Releases: phpro/soap-client

Version 3.3.0

21 May 17:04
3.3.0
66eb962
Compare
Choose a tag to compare

What's Changed

  • Consider nullability for properties by @lstrojny in #516
  • Fix invalid array bounds during static analysis by @veewee in #518

New Contributors

Full Changelog: 3.2.0...3.3.0

3.2.0

26 Apr 13:36
3.2.0
05bded4
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.1.2...3.2.0

Version 3.1.2

02 Apr 14:10
3.1.2
7b7cd0e
Compare
Choose a tag to compare

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

21 Dec 13:21
3.1.1
60a6631
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.1.0...3.1.1

Version 3.1.0

24 Nov 08:01
3.1.0
116c609
Compare
Choose a tag to compare

What's Changed

Full Changelog: 3.0.0...3.1.0

Release 3.0.0

29 Sep 06:54
3.0.0
Compare
Choose a tag to compare

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:

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

07 Jun 07:22
2.4.2
a008ad5
Compare
Choose a tag to compare

What's Changed

  • Allow newer version of laminas/laminas-code by @lkck24 in #476

New Contributors

Full Changelog: 2.4.1...2.4.2

Version 2.4.1

26 May 07:06
2.4.1
72e6797
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.4.0...2.4.1

3.0.0 - Alpha 1

29 Apr 08:40
3.0.0-alpha1
964a989
Compare
Choose a tag to compare
3.0.0 - Alpha 1 Pre-release
Pre-release

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

14 Feb 11:04
2.4.0
439f922
Compare
Choose a tag to compare

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