diff --git a/config/services.yaml b/config/services.yaml index 6cd421a5..265db7ee 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -28,7 +28,7 @@ services: autoconfigure: true bind: $proxyHostIp: '%env(PROXY_HOST_IP)%' - $proxyPort: '%env(PROXY_HOST_PORT)%' + $proxyHostPort: '%env(PROXY_HOST_PORT)%' $allegroEndpoint: '%env(ALLEGRO_ENDPOINT)%' $allegroOnbekendeSchuldeiser: '%env(ALLEGRO_ONBEKENDE_SCHULDEISER)%' string $azureAuthorityHost: '%env(AZURE_AUTHORITY_HOST)%' diff --git a/src/Allegro/AllegroHelper.php b/src/Allegro/AllegroHelper.php index b215ab0b..b48f70ef 100644 --- a/src/Allegro/AllegroHelper.php +++ b/src/Allegro/AllegroHelper.php @@ -12,21 +12,21 @@ class AllegroHelper /** * Creates a SOAP options array with optional proxy settings. * - * @param string|null $proxyHost The proxy host (IP or domain). - * @param string|null $proxyPort The proxy port. + * @param string|null $proxyHostIp The proxy IP address. + * @param string|null $proxyHostPort The proxy port. * @return array The SOAP options array. */ public static function createSoapOptionsArray( - ?string $proxyHost = null, - ?string $proxyPort = null + ?string $proxyHostIp = null, + ?string $proxyHostPort = null ): array { $soapOptionsArray = []; - if (isset($proxyHost, $proxyPort)) { + if (isset($proxyHostIp, $proxyHostPort)) { $streamContext = stream_context_create([ 'http' => [ - 'proxy' => 'tcp://' . $proxyHost . ':' . $proxyPort, + 'proxy' => 'tcp://' . $proxyHostIp . ':' . $proxyHostPort, 'request_fulluri' => true, ], ]); @@ -40,19 +40,19 @@ public static function createSoapOptionsArray( /** * Creates a SOAP client configuration array with optional proxy settings. * - * @param string|null $proxyHost The proxy host (IP or domain). - * @param string|null $proxyPort The proxy port. + * @param string|null $proxyHostIp The proxy IP address. + * @param string|null $proxyHostPort The proxy port. * @return array The SOAP client configuration array. */ public static function createSoapClientConfig( - ?string $proxyHost = null, - ?string $proxyPort = null + ?string $proxyHostIp = null, + ?string $proxyHostPort = null ): array { $config = ['headers' => ['User-Agent' => 'fixxx-schuldhulp/1.0']]; - if (isset($proxyHost, $proxyPort)) { - $config['proxy'] = 'http://' . $proxyHost . ':' . $proxyPort; + if (isset($proxyHostIp, $proxyHostPort)) { + $config['proxy'] = 'http://' . $proxyHostIp . ':' . $proxyHostPort; } return $config; @@ -62,17 +62,17 @@ public static function createSoapClientConfig( * Creates a SOAP client handler with optional proxy and session middleware. * * @param Organisatie|null $organisatie The organization for session middleware. - * @param string|null $proxyHost The proxy host (IP or domain). - * @param string|null $proxyPort The proxy port. + * @param string|null $proxyHostIp The proxy IP address. + * @param string|null $proxyHostPort The proxy port. * @return HandlerInterface The configured SOAP client handler. */ public static function createSoapClientHandler( ?Organisatie $organisatie = null, - ?string $proxyHost = null, - ?string $proxyPort = null + ?string $proxyHostIp = null, + ?string $proxyHostPort = null ) : HandlerInterface { - $config = AllegroHelper::createSoapClientConfig($proxyHost, $proxyPort); + $config = AllegroHelper::createSoapClientConfig($proxyHostIp, $proxyHostPort); $handler = HttPlugHandle::createForClient( Client::createWithConfig($config) diff --git a/src/Allegro/LoginClientFactory.php b/src/Allegro/LoginClientFactory.php index 74465fca..727b84c5 100644 --- a/src/Allegro/LoginClientFactory.php +++ b/src/Allegro/LoginClientFactory.php @@ -14,12 +14,12 @@ class LoginClientFactory public static function factory( string $wsdl, ?Organisatie $organisatie = null, - ?string $proxyHost = null, - ?string $proxyPort = null + ?string $proxyHostIp = null, + ?string $proxyHostPort = null ): AllegroLoginClient { - $extSoapOptionsArray = AllegroHelper::createSoapOptionsArray($proxyHost, $proxyPort); + $extSoapOptionsArray = AllegroHelper::createSoapOptionsArray($proxyHostIp, $proxyHostPort); - $handler = AllegroHelper::createSoapClientHandler($organisatie, $proxyHost, $proxyPort); + $handler = AllegroHelper::createSoapClientHandler($organisatie, $proxyHostIp, $proxyHostPort); $engine = ExtSoapEngineFactory::fromOptionsWithHandler( ExtSoapOptions::defaults($wsdl, $extSoapOptionsArray)->withClassMap( diff --git a/src/Allegro/SchuldHulpClientFactory.php b/src/Allegro/SchuldHulpClientFactory.php index 1d6d87b8..4f2cfde0 100644 --- a/src/Allegro/SchuldHulpClientFactory.php +++ b/src/Allegro/SchuldHulpClientFactory.php @@ -14,13 +14,13 @@ class SchuldHulpClientFactory public static function factory( string $wsdl, Organisatie $organisatie, - ?string $proxyHost = null, - ?string $proxyPort = null + ?string $proxyHostIp = null, + ?string $proxyHostPort = null ): AllegroSchuldHulpClient { - $handler = AllegroHelper::createSoapClientHandler($organisatie, $proxyHost, $proxyPort); + $handler = AllegroHelper::createSoapClientHandler($organisatie, $proxyHostIp, $proxyHostPort); - $extSoapOptions = AllegroHelper::createSoapOptionsArray($proxyHost, $proxyPort); + $extSoapOptions = AllegroHelper::createSoapOptionsArray($proxyHostIp, $proxyHostPort); $engine = ExtSoapEngineFactory::fromOptionsWithHandler( ExtSoapOptions::defaults($wsdl, $extSoapOptions)->withClassMap(AllegroSchuldHulpClassmap::getCollection()), diff --git a/src/Service/AllegroService.php b/src/Service/AllegroService.php index aaa59eec..15b74b57 100644 --- a/src/Service/AllegroService.php +++ b/src/Service/AllegroService.php @@ -116,7 +116,7 @@ class AllegroService /** * @var ?string */ - private $proxyPort; + private $proxyHostPort; public function __construct( @@ -128,7 +128,7 @@ public function __construct( Security $security, $allegroOnbekendeSchuldeiser, ?string $proxyHostIp = null, - ?string $proxyPort = null, + ?string $proxyHostPort = null, ) { $this->loginWsdl = sprintf('%s?service=LoginService', $allegroEndpoint); $this->schuldHulpWsdl = sprintf('%s?service=SchuldHulpService', $allegroEndpoint); @@ -139,7 +139,7 @@ public function __construct( $this->em = $em; $this->onbekendeSchuldeiser = (string)$allegroOnbekendeSchuldeiser; $this->proxyHostIp = $proxyHostIp; - $this->proxyPort = $proxyPort; + $this->proxyHostPort = $proxyHostPort; } /** @@ -157,7 +157,7 @@ public function login(Organisatie $organisatie, $force = false) ) >= $oldestAllowedSession) { return $organisatie; } - $response = $this->getLoginService(null, $this->proxyHostIp, $this->proxyPort)->allegroWebLogin( + $response = $this->getLoginService(null, $this->proxyHostIp, $this->proxyHostPort)->allegroWebLogin( (new LoginServiceAllegroWebLogin( $organisatie->getAllegroUsername(), $organisatie->getAllegroPassword() @@ -185,7 +185,7 @@ public function login(Organisatie $organisatie, $force = false) public function getSRVAanvraagHeader(Organisatie $organisatie, string $relatieCode): ?TSRVAanvraagHeader { $organisatie = $this->login($organisatie); - $schuldhulpService = $this->getSchuldHulpService($organisatie, $this->proxyHostIp, $this->proxyPort); + $schuldhulpService = $this->getSchuldHulpService($organisatie, $this->proxyHostIp, $this->proxyHostPort); $response = $schuldhulpService->getSRVOverzicht( (new SchuldHulpServiceGetSRVOverzicht($relatieCode)) ); @@ -202,7 +202,7 @@ public function getSRVAanvraagHeader(Organisatie $organisatie, string $relatieCo public function getSRVAanvraag(Organisatie $organisatie, TSRVAanvraagHeader $header): ?TSRVAanvraag { $organisatie = $this->login($organisatie); - $schuldhulpService = $this->getSchuldHulpService($organisatie, $this->proxyHostIp, $this->proxyPort); + $schuldhulpService = $this->getSchuldHulpService($organisatie, $this->proxyHostIp, $this->proxyHostPort); $response = $schuldhulpService->getSRVAanvraag( (new SchuldHulpServiceGetSRVAanvraag($header)) ); @@ -496,15 +496,15 @@ private function mapSchulden(Dossier $dossier): SchuldArray private function getSchuldHulpService( Organisatie $organisatie, - ?string $proxyHost = null, - ?string $proxyPort = null + ?string $proxyHostIp = null, + ?string $proxyHostPort = null ): AllegroSchuldHulpClient { return SchuldHulpClientFactory::factory( - $this->schuldHulpWsdl, + $this->schuldHulpWsdl, $organisatie, - $proxyHost, - $proxyPort + $proxyHostIp, + $proxyHostPort ); } @@ -523,14 +523,14 @@ public function updateDossier(Dossier $dossier) private function getLoginService( ?Organisatie $organisatie = null, - ?string $proxyHost = null, - ?string $proxyPort = null + ?string $proxyHostIp = null, + ?string $proxyHostPort = null ): AllegroLoginClient { return LoginClientFactory::factory( $this->loginWsdl, $organisatie, - $proxyHost, - $proxyPort + $proxyHostIp, + $proxyHostPort ); } @@ -540,8 +540,8 @@ private function getLoginService( */ public function getSRVEisers(Dossier $dossier, TSRVAanvraagHeader $header): ?TSRVEisers { - $schuldhulpService = $this->getSchuldHulpService($dossier->getOrganisatie(), $this->proxyHostIp, $this->proxyPort); - + $schuldhulpService = $this->getSchuldHulpService($dossier->getOrganisatie(), $this->proxyHostIp, $this->proxyHostPort); + return $schuldhulpService->getSRVEisers( (new SchuldHulpServiceGetSRVEisers( (new TSRVAanvraagHeader( @@ -634,7 +634,7 @@ public function syncSchuldeisers(Organisatie $organisatie, $searchString = ''): { $organisatie = $this->login($organisatie); $parameters = new SchuldHulpServiceGetLijstSchuldeisers($searchString); - $schuldhulpService = $this->getSchuldHulpService($organisatie, $this->proxyHostIp, $this->proxyPort); + $schuldhulpService = $this->getSchuldHulpService($organisatie, $this->proxyHostIp, $this->proxyHostPort); $response = $schuldhulpService->getLijstSchuldeisers($parameters); $statistics = ['created' => 0, 'updated' => 0];