Download Latest Version Version 6.0.0 source code.tar.gz (102.9 kB)
Email in envelope

Get an email when there's a new version of General purpose PHP SOAP-client

Home / 5.0.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-03-19 3.4 kB
Version 5.0.0 source code.tar.gz 2026-03-19 102.8 kB
Version 5.0.0 source code.zip 2026-03-19 285.8 kB
Totals: 3 Items   392.1 kB 0

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.

Upgrading

:::bash
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

Full Changelog: https://github.com/phpro/soap-client/compare/4.6.0...5.0.0

Source: README.md, updated 2026-03-19