Skip to content

Release 2.0.0

Choose a tag to compare

@zepgram zepgram released this 19 Feb 11:43
· 18 commits to master since this release
3ea4ad6

What's Changed

  • [v2.0.0] new implementation with pattern ease of use by @zepgram in #3

Full Changelog: v1.1.3...v2.0.0

Pattern implementation

The module was a bit complexe to implement, so it has been simplified to provide more flexibility:

  • ApiFactory has been removed
  • ApiProvider can be directly injected to send a request
  • ApiPool has replaced ApiFactory to fetch an ApiProvider.

Benefits

I've been working with this module for a while now, and one of the weakness was the ability to find the RequestAdapter while running a request. You had to search in your di.xml for a reference on my_awesome_service by yourself.
To simplify, instead of this:

$this->apiFactory->get('my_awesome_service', $data)->sendRequest();

Now we have this:

$this->apiPool->execute(MyAwesomeRequestAdapter::class, $data);

By doing this the developer and also the code reader are now able to easily find MyAwesomeRequestAdapter class, which is basicly the service contract used by the ApiProvider.

Aftermath

Now ApiProvider and RequestAdapter have a relation 1:1

Previously, you could use the same RequestAdapter for multiple ApiProvider (1:M), this is not the case anymore.

Breaking change

⚠️ This release has breaking change: other releases will not be maintained anymore.

If you want to install v2.0.0 you must adapt your code.