maciekpaprocki/wordpress-guzzle-wrapper

dev-master / 1.0.x-dev 2016-05-25 13:34 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:09:00 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Simple helper for working with Guzzle and wordpress rest API

Install

Via Composer

$ composer require maciekpaprocki/wordpress-guzzle-wrapper

Usage

Repositories

Repositories are de facto your query builders.

Provided with query information they need to return async promise (or whatever wrapped in promise).

Transformers

Transformers are responsible for converting data received from async calls. All the data is transformed using json_decode then if data is object transformers are run on whole data set. If data is array transformers are run on each of the array values.

Pool

Pool is responsible for aggregating three services.

  1. Transformers
  2. Cache
    use BureauVA\WordpressGuzzle\Pool;
    $pool = new Pool();
    $pool->setTransformers(...Transformer Array);
    $pool->setCachePool(...External Cache Pool);
    $pool->setPromises(...Promises array);
    

Contributing

Yope, so you need to have those ones installed globaly:

  1. Composer
  2. PHP CS Fixer
  3. PHPUNIT

then run those lines in empty folder of your choice

git clone git@github.com:bureau-va/wordpress-guzzle-wrapper.git .
touch .git/hooks/pre-commit
sudo chmod 777 .git/hooks/pre-commit
echo "composer pre-commit" >> .git/hooks/pre-commit

this will set up base repo and make sure that before each commit your local tests and cs fixer are used.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Credits

License

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