27 lines
543 B
PHP
27 lines
543 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Malio\EdnotifBundle\Shared\Soap;
|
|
|
|
use SoapClient;
|
|
|
|
final class SoapClientFactory
|
|
{
|
|
/**
|
|
* @param array<string,mixed> $soapOptions
|
|
*/
|
|
public function __construct(private array $soapOptions = []) {}
|
|
|
|
public function create(string $wsdl): SoapClient
|
|
{
|
|
$options = $this->soapOptions;
|
|
|
|
// Petites valeurs sûres par défaut
|
|
$options['encoding'] ??= 'UTF-8';
|
|
$options['exceptions'] ??= true;
|
|
|
|
return new SoapClient($wsdl, $options);
|
|
}
|
|
}
|