From 85a46a9598b78f06526c5c60dd31637cc19f4c15 Mon Sep 17 00:00:00 2001 From: Antonio De Marco Date: Tue, 21 Jan 2025 10:11:24 +0100 Subject: [PATCH] EWPP-4991: Patch normalizer and re-run export. --- composer.json | 9 ++++++++- config/soap-client-authentication.php | 7 +++++++ patches/add-anyuri-to-normalizer.patch | 12 ++++++++++++ .../ClientCertificateClassmap.php | 1 + .../ClientCertificateClient.php | 1 + .../ClientCertificate/Type/GetServiceTicket.php | 16 ++++++++-------- src/Notification/NotificationClassmap.php | 1 + src/Request/RequestClassmap.php | 1 + src/Request/RequestClient.php | 1 + 9 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 patches/add-anyuri-to-normalizer.patch diff --git a/composer.json b/composer.json index 307effc1..7d6fe46f 100644 --- a/composer.json +++ b/composer.json @@ -69,5 +69,12 @@ }, "bin": ["bin/epoetry"], "minimum-stability": "dev", - "prefer-stable": true + "prefer-stable": true, + "extra": { + "patches": { + "phpro/soap-client" : { + "add-anyuri-to-normalizer.patch": "./patches/add-anyuri-to-normalizer.patch" + } + } + } } diff --git a/config/soap-client-authentication.php b/config/soap-client-authentication.php index ba6e9c34..c3e2dbf8 100644 --- a/config/soap-client-authentication.php +++ b/config/soap-client-authentication.php @@ -5,6 +5,7 @@ use Phpro\SoapClient\CodeGenerator\Config\Config; use Soap\ExtSoapEngine\ExtSoapOptions; use Phpro\SoapClient\Soap\DefaultEngineFactory; +use OpenEuropa\EPoetry\CodeGenerator as OpenEuropa; // Generate SOAP client library to perform ECAS client certificate login. // @link https://citnet.tech.ec.europa.eu/CITnet/confluence/display/IAM/ECAS+Certificate+Login @@ -24,6 +25,12 @@ ->setClassMapDestination('src/Authentication/ClientCertificate') ->setClassMapName('ClientCertificateClassmap') ->setClassMapNamespace('OpenEuropa\EPoetry\Authentication\ClientCertificate') + ->addRule(new Rules\AssembleRule( + new OpenEuropa\Assembler\OverridePropertyTypeAssembler( + (new OpenEuropa\Assembler\OverridePropertyTypeAssemblerOptions()) + ->setPropertyTypeMapping([]) + ) + )) ->addRule(new Rules\AssembleRule(new Assembler\GetterAssembler(new Assembler\GetterAssemblerOptions()))) ->addRule(new Rules\AssembleRule(new Assembler\ImmutableSetterAssembler( new Assembler\ImmutableSetterAssemblerOptions() diff --git a/patches/add-anyuri-to-normalizer.patch b/patches/add-anyuri-to-normalizer.patch new file mode 100644 index 00000000..e6e08796 --- /dev/null +++ b/patches/add-anyuri-to-normalizer.patch @@ -0,0 +1,12 @@ +diff --git a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php +index 0f33a7f..76bcea5 100644 +--- a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php ++++ b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php +@@ -15,6 +15,7 @@ class Normalizer + 'any' => 'mixed', + 'anytype' => 'mixed', + 'anyxml' => 'string', ++ 'anyuri' => 'string', + 'anysimpletype' => 'mixed', + 'long' => 'int', + 'short' => 'int', diff --git a/src/Authentication/ClientCertificate/ClientCertificateClassmap.php b/src/Authentication/ClientCertificate/ClientCertificateClassmap.php index 3a6a3bdf..f3c966f7 100644 --- a/src/Authentication/ClientCertificate/ClientCertificateClassmap.php +++ b/src/Authentication/ClientCertificate/ClientCertificateClassmap.php @@ -16,3 +16,4 @@ public static function getCollection() : \Soap\ExtSoapEngine\Configuration\Class ); } } + diff --git a/src/Authentication/ClientCertificate/ClientCertificateClient.php b/src/Authentication/ClientCertificate/ClientCertificateClient.php index d62061a2..57091ed6 100644 --- a/src/Authentication/ClientCertificate/ClientCertificateClient.php +++ b/src/Authentication/ClientCertificate/ClientCertificateClient.php @@ -35,3 +35,4 @@ public function getServiceTicket(\OpenEuropa\EPoetry\Authentication\ClientCertif return $response; } } + diff --git a/src/Authentication/ClientCertificate/Type/GetServiceTicket.php b/src/Authentication/ClientCertificate/Type/GetServiceTicket.php index 69118be9..e69b932c 100644 --- a/src/Authentication/ClientCertificate/Type/GetServiceTicket.php +++ b/src/Authentication/ClientCertificate/Type/GetServiceTicket.php @@ -7,33 +7,33 @@ class GetServiceTicket implements RequestInterface { /** - * @var \OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI + * @var string */ - private \OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI $service; + private string $service; /** * Constructor * - * @param \OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI $service + * @param string $service */ - public function __construct(\OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI $service) + public function __construct(string $service) { $this->service = $service; } /** - * @return \OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI + * @return string */ - public function getService() : \OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI + public function getService() : string { return $this->service; } /** - * @param \OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI $service + * @param string $service * @return static */ - public function withService(\OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\AnyURI $service) : static + public function withService(string $service) : static { $new = clone $this; $new->service = $service; diff --git a/src/Notification/NotificationClassmap.php b/src/Notification/NotificationClassmap.php index 84b736e9..86380f6d 100644 --- a/src/Notification/NotificationClassmap.php +++ b/src/Notification/NotificationClassmap.php @@ -22,3 +22,4 @@ public static function getCollection() : \Soap\ExtSoapEngine\Configuration\Class ); } } + diff --git a/src/Request/RequestClassmap.php b/src/Request/RequestClassmap.php index b6495fc8..e015b5b4 100644 --- a/src/Request/RequestClassmap.php +++ b/src/Request/RequestClassmap.php @@ -69,3 +69,4 @@ public static function getCollection() : \Soap\ExtSoapEngine\Configuration\Class ); } } + diff --git a/src/Request/RequestClient.php b/src/Request/RequestClient.php index a655f7e4..58636f26 100644 --- a/src/Request/RequestClient.php +++ b/src/Request/RequestClient.php @@ -140,3 +140,4 @@ public function createCorrectionRequest(\OpenEuropa\EPoetry\Request\Type\CreateC return $response; } } +