cuyz/webz

Library that aims to abstract calls to different WebServices (in HTTP or SOAP)

0.12.0 2021-04-16 17:55 UTC

This package is auto-updated.

Last update: 2024-04-03 18:00:28 UTC


README

Latest Version on Packagist Master Total Downloads Software License

⚠️ This project is in the experimental phase. The API may change any time.

The complete documentation is available at: https://cuyz.io/WebZ/

WebZ is a library that aims to abstract calls to different WebServices (in HTTP or SOAP).

It automatically handles caching, events and parsing results to an array.

$bus = WebServiceBus::builder()
    ->withTransport(new HttpTransport())
    ->withTransport(new SoapTransport())
    ->withCache(new SomeCacheStore())
    ->withEventDispatcher(new SomeEventsDispatcher())
    ->build();

// Synchronous
$foo = $bus->call(new GetFooWebService(123));

// Asynchronous
$promises = $bus->callAsync(
    new GetFooWebService(123),
    new GetFooWebService(456),
);

foreach ($promises as $promise) {
    $foo = $promise->wait();
}

Licence

The MIT License (MIT). Please see License File for more information.