Skip to content

5.0.0-beta1

Pre-release
Pre-release

Choose a tag to compare

@veewee veewee released this 03 Mar 07:35
· 5 commits to v4.x since this release
5.0.0-beta1
602b289

This pre-release is experimental

V5 overhauls the code generation configuration system with proper value objects, introduces XML namespace-aware type mapping, customizable coding standards, and improved default value handling for generated code.

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!

Upgrading

composer require 'phpro/soap-client:^5.0.0-beta1@beta' --update-with-dependencies

You'll need to update your code generation configuration file.
For a step-by-step plan, you can follow the instructions at:

https://github.com/phpro/soap-client/blob/v5.x/UPGRADING.md#v4-to-v5

What's new

Configuration overhaul

The Config class no longer uses individual string setters. Instead, dedicated value objects — Destination, ClientConfig, ClassMapConfig, and TypeNamespaceMap — replace the old setTypeNamespace(), setTypeDestination(), setClientName(), etc. methods. The ConfigInterface has been removed.

TypeNamespaceMap: XML namespace-aware type mapping

A new TypeNamespaceMap allows you to map XML namespaces (xmlns) to specific PHP namespace destinations. This is useful when a WSDL defines types across multiple XML namespaces and you want to organize them into separate directories.

You can use explicit withMapping() calls, a built-in PrefixBasedTypeNamespaceStrategy for automatic resolution, or combine both. The generate:config command now detects xmlns namespaces from your WSDL and suggests mappings in the generated config.

Duplicate type strategies (IntersectDuplicateTypesStrategy and RemoveDuplicateTypesStrategy) are now namespace-aware — types that map to different PHP namespaces are no longer considered duplicates.

Coding standards strategy

A new CodingStandardsStrategyInterface lets you customize naming conventions for all generated code. By default, DefaultCodingStandardsStrategy is used, which matches existing behavior — no changes required for existing users.

Configure it via Config::setCodingStandards(). Context classes (TypeContext, PropertyContext, ClientMethodContext, ClassMapContext) now require CodeGeneratorContext as an additional constructor parameter. Property gains new convenience methods methodName() and parameterName() that use the configured coding standards.

Constructor and property default values

The old PropertyDefaultsAssembler has been removed. Its functionality is now built into PropertyAssembler and ConstructorAssembler via a new DefaultValuesStrategy enum:

  • OptionalOnly (new default) — Only nullable/optional properties get = null
  • All (previous default) — All scalars get zero-value defaults
  • None — No defaults applied

What's Changed

  • Introduce TypeNamespaceMap strategy system by @veewee in #599
  • Introduce constructor & property default values with ScalarDefaultProvider by @veewee in #601
  • Introduce CodingStandardsStrategy for customizable naming conventions by @veewee in #602

Full Changelog: 4.6.0...5.0.0-beta1