rocketfellows / soap-client-factory
v1.0.0
2023-12-09 14:49 UTC
Requires
- php: >=7.4
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^8.5
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: 3.6.2
README
PHP SOAP client factory - is a wrapper around PHP SoapClient
initialization.
Initialization of the client when the create function is called, and not at the time of instantiation of the dependency.
More about PHP SoapClient
here: https://www.php.net/manual/en/class.soapclient.php.
Installation.
composer require rocketfellows/soap-client-factory
Package details.
Component composition:
SoapClientFactory
- factory for creating PHPSoapClient
with given parameters.
SoapClientFactory
functions:
public function create(string $wsdl, ?array $options = []): SoapClient
- factory-function takes as parameters the string$wsdl
(URI of the WSDL file or NULL if working in non-WSDL mode) and an optional array of parameters$options
. More details about the parameters at https://www.php.net/manual/en/class.soapclient.php.
Throwable exceptions:
SoapFault
- https://www.php.net/manual/ru/class.soapfault.php.
Usage example.
Create instance of SoapClientFactory
and call create
function with arguments for PHP SoapClient
:
$client = (new SoapClientFactory())->create('test.wsdl');
Contributing.
Welcome to pull requests. If there is a major changes, first please open an issue for discussion.
Please make sure to update tests as appropriate.