diff --git a/UPGRADING.md b/UPGRADING.md index 6c830703..828d7335 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -45,6 +45,9 @@ Regenerate classes: ./vendor/bin/soap-client generate:clientfactory --config=config/soap-client.php ``` +**Note:** The generated code might have slightly changed for your project. +Validate if you are still using the correct methods in your implementation. + Change the engine inside your (generated) ClientFactory: ```php diff --git a/spec/Phpro/SoapClient/CodeGenerator/Util/NormalizerSpec.php b/spec/Phpro/SoapClient/CodeGenerator/Util/NormalizerSpec.php index 36721c76..666e1822 100644 --- a/spec/Phpro/SoapClient/CodeGenerator/Util/NormalizerSpec.php +++ b/spec/Phpro/SoapClient/CodeGenerator/Util/NormalizerSpec.php @@ -81,11 +81,11 @@ function it_generates_property_methods() { $this->generatePropertyMethod('get', 'prop1')->shouldReturn('getProp1'); $this->generatePropertyMethod('set', 'prop1')->shouldReturn('setProp1'); - $this->generatePropertyMethod('get', 'prop1_test*./')->shouldReturn('getProp1Test'); + $this->generatePropertyMethod('get', 'prop1_test*./')->shouldReturn('getProp1_test'); $this->generatePropertyMethod('get', 'UpperCased')->shouldReturn('getUpperCased'); - $this->generatePropertyMethod('get', 'my-./*prop_123')->shouldReturn('getMyProp123'); - $this->generatePropertyMethod('get', 'My-./*prop_123')->shouldReturn('getMyProp123'); - $this->generatePropertyMethod('get', 'My-./final*prop_123')->shouldReturn('getMyFinalProp123'); + $this->generatePropertyMethod('get', 'my-./*prop_123')->shouldReturn('getMyProp_123'); + $this->generatePropertyMethod('get', 'My-./*prop_123')->shouldReturn('getMyProp_123'); + $this->generatePropertyMethod('get', 'My-./final*prop_123')->shouldReturn('getMyFinalProp_123'); $this->generatePropertyMethod('get', 'final')->shouldReturn('getFinal'); $this->generatePropertyMethod('set', 'Final')->shouldReturn('setFinal'); $this->generatePropertyMethod('set', '_')->shouldReturn('set_'); diff --git a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php index 2d642c65..ef2e90f7 100644 --- a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php +++ b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php @@ -234,7 +234,7 @@ public static function isKnownType(string $type): bool */ public static function generatePropertyMethod(string $prefix, string $property): string { - $normalized = $property === '_' ? $property : self::camelCase($property, '{[^a-z0-9]+}i'); + $normalized = $property === '_' ? $property : self::camelCase($property, '{[^a-z0-9_]+}i'); return strtolower($prefix).ucfirst($normalized); }