Skip to content

Commit

Permalink
EWPP-4991: Use CodeGeneratorEngineFactory.
Browse files Browse the repository at this point in the history
  • Loading branch information
ademarco committed Jan 21, 2025
1 parent 85a46a9 commit c059f1e
Show file tree
Hide file tree
Showing 81 changed files with 2,162 additions and 1,289 deletions.
16 changes: 3 additions & 13 deletions config/soap-client-authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
use Phpro\SoapClient\CodeGenerator\Assembler;
use Phpro\SoapClient\CodeGenerator\Rules;
use Phpro\SoapClient\CodeGenerator\Config\Config;
use Soap\ExtSoapEngine\ExtSoapOptions;
use Phpro\SoapClient\Soap\DefaultEngineFactory;
use OpenEuropa\EPoetry\CodeGenerator as OpenEuropa;
use Phpro\SoapClient\Soap\CodeGeneratorEngineFactory;

// Generate SOAP client library to perform ECAS client certificate login.
// @link https://citnet.tech.ec.europa.eu/CITnet/confluence/display/IAM/ECAS+Certificate+Login
// WSDL used for generating the SOAP codebase can be found here:
// @link https://webgate.ec.europa.eu/cas/ws/CertLoginService.wsdl
// The content returned by the URL above is stored locally in resources/authentication.wsdl.
$engine = CodeGeneratorEngineFactory::create('./resources/authentication.wsdl');
return Config::create()
->setEngine($engine = DefaultEngineFactory::create(
ExtSoapOptions::defaults(__DIR__.'/../resources/authentication.wsdl', [])
->disableWsdlCache()
))
->setEngine($engine)
->setTypeDestination('src/Authentication/ClientCertificate/Type')
->setTypeNamespace('OpenEuropa\EPoetry\Authentication\ClientCertificate\Type')
->setClientDestination('src/Authentication/ClientCertificate')
Expand All @@ -25,12 +21,6 @@
->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()
Expand Down
12 changes: 5 additions & 7 deletions config/soap-client-notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

use OpenEuropa\EPoetry\CodeGenerator\ConfigProcessor;
use Phpro\SoapClient\CodeGenerator\Config\Config;
use Soap\ExtSoapEngine\ExtSoapOptions;
use Phpro\SoapClient\Soap\DefaultEngineFactory;
use Phpro\SoapClient\Soap\CodeGeneratorEngineFactory;

$engine = CodeGeneratorEngineFactory::create('./resources/notification.wsdl');
$config = Config::create()
->setEngine($engine = DefaultEngineFactory::create(
ExtSoapOptions::defaults('./resources/notification.wsdl', [])
->disableWsdlCache()
))
->setEngine($engine)
->setTypeDestination('src/Notification/Type')
->setTypeNamespace('OpenEuropa\EPoetry\Notification\Type')
->setClientDestination('src/Notification/')
->setClientNamespace('OpenEuropa\EPoetry\Notification')
->setClassMapDestination('src/Notification/')
->setClassMapName('NotificationClassmap')
->setClassMapNamespace('OpenEuropa\EPoetry\Notification');
->setClassMapNamespace('OpenEuropa\EPoetry\Notification')
;

return ConfigProcessor::addRules($config);
9 changes: 3 additions & 6 deletions config/soap-client-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

use OpenEuropa\EPoetry\CodeGenerator\ConfigProcessor;
use Phpro\SoapClient\CodeGenerator\Config\Config;
use Soap\ExtSoapEngine\ExtSoapOptions;
use Phpro\SoapClient\Soap\DefaultEngineFactory;
use Phpro\SoapClient\Soap\CodeGeneratorEngineFactory;

$engine = CodeGeneratorEngineFactory::create('./resources/request.wsdl');
$config = Config::create()
->setEngine($engine = DefaultEngineFactory::create(
ExtSoapOptions::defaults('./resources/request.wsdl', [])
->disableWsdlCache()
))
->setEngine($engine)
->setTypeDestination('src/Request/Type')
->setTypeNamespace('OpenEuropa\EPoetry\Request\Type')
->setClientDestination('src/Request/')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
class GetServiceTicket implements RequestInterface
{
/**
* The target service for which you want to obtain a service ticket.
* This must be a valid URL.
*
* @var string
*/
private string $service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
class GetServiceTicketResponse implements ResultInterface
{
/**
* Service ticket for the specified service.
*
* @var string
*/
private string $serviceTicket;
Expand Down
108 changes: 0 additions & 108 deletions src/CodeGenerator/Assembler/NullableGetterAssembler.php

This file was deleted.

142 changes: 0 additions & 142 deletions src/CodeGenerator/Assembler/NullableGetterAssemblerOptions.php

This file was deleted.

5 changes: 2 additions & 3 deletions src/CodeGenerator/ConfigProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ public static function addRules(Config $config, array $specialClassesAndProperti
->whitelist($specialClassesAndProperties)
);

$defaultGetterAssembler = new OpenEuropa\Assembler\NullableGetterAssembler(
OpenEuropa\Assembler\NullableGetterAssemblerOptions::create()
$defaultGetterAssembler = new Assembler\GetterAssembler(
Assembler\GetterAssemblerOptions::create()
->withReturnType()
->withBoolGetters()
->withReturnNull()
);

$arrayGetterAssembler = new OpenEuropa\Assembler\ArrayGetterAssembler(
Expand Down
Loading

0 comments on commit c059f1e

Please sign in to comment.