-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from mcg-web/promise-adapter
Add promise adapter
- Loading branch information
Showing
25 changed files
with
906 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
indent_size = 4 | ||
trim_trailing_whitespace = false | ||
|
||
[*.mk,Makefile] | ||
indent_style = tab | ||
|
||
[*.php] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/vendor/ | ||
/bin | ||
composer.lock | ||
composer.phar | ||
phpunit.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
language: php | ||
|
||
php: | ||
- nightly | ||
- hhvm | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- nightly | ||
- hhvm | ||
|
||
branches: | ||
only: | ||
- master | ||
- /^\d+\.\d+$/ | ||
only: | ||
- master | ||
- /^\d+\.\d+$/ | ||
|
||
allow_failures: | ||
matrix: | ||
allow_failures: | ||
- php: nightly | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
before_install: | ||
- if [[ "$TRAVIS_PHP_VERSION" != "5.6" && "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini || true; fi | ||
- composer selfupdate | ||
- composer require "guzzlehttp/promises" | ||
- if [[ "$TRAVIS_PHP_VERSION" != "5.6" && "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini || true; fi | ||
- composer selfupdate | ||
|
||
install: composer update --prefer-dist --no-interaction | ||
|
||
script: if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then phpunit -d xdebug.max_nesting_level=1000 --debug --coverage-clover build/logs/clover.xml; else phpunit --debug; fi | ||
script: | ||
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then bin/phpunit --debug --coverage-clover build/logs/clover.xml; else bin/phpunit --debug; fi | ||
- if [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then composer require "friendsofphp/php-cs-fixer:^2.0" && bin/php-cs-fixer fix --diff --dry-run -v; fi; | ||
|
||
after_success: | ||
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then composer require "satooshi/php-coveralls:^1.0" && travis_retry php vendor/bin/coveralls -v; fi | ||
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then composer require "satooshi/php-coveralls:^1.0" && travis_retry php bin/coveralls -v; fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,43 @@ | ||
{ | ||
"name": "overblog/dataloader-php", | ||
"type": "library", | ||
"license": "MIT", | ||
"description": "DataLoaderPhp is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.", | ||
"keywords": ["dataLoader", "caching", "batching"], | ||
"autoload": { | ||
"psr-4": { | ||
"Overblog\\DataLoader\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Overblog\\DataLoader\\Tests\\": "tests/" | ||
} | ||
}, | ||
"require": { | ||
"php": "^5.5|^7.0", | ||
"mcg-web/promise-factory": "^0.2" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^4.1|^5.1" | ||
"name": "overblog/dataloader-php", | ||
"type": "library", | ||
"license": "MIT", | ||
"description": "DataLoaderPhp is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.", | ||
"keywords": ["dataLoader", "caching", "batching"], | ||
"config" : { | ||
"bin-dir": "bin", | ||
"sort-packages": true | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Overblog\\DataLoader\\": "src/", | ||
"Overblog\\PromiseAdapter\\": "lib/promise-adapter/src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Overblog\\DataLoader\\Test\\": "tests/", | ||
"Overblog\\PromiseAdapter\\Test\\": "lib/promise-adapter/tests/" | ||
} | ||
}, | ||
"replace": { | ||
"overblog/promise-adapter": "self.version" | ||
}, | ||
"require": { | ||
"php": "^5.5|^7.0" | ||
}, | ||
"require-dev": { | ||
"guzzlehttp/promises": "^1.3.0", | ||
"phpunit/phpunit": "^4.1|^5.1", | ||
"react/promise": "^2.5.0" | ||
}, | ||
"suggest": { | ||
"guzzlehttp/promises": "To use with Guzzle promise", | ||
"react/promise": "To use with ReactPhp promise" | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "0.3-dev" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/vendor/ | ||
composer.lock | ||
composer.phar | ||
phpunit.xml | ||
/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
language: php | ||
|
||
php: | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- nightly | ||
- hhvm | ||
|
||
branches: | ||
only: | ||
- master | ||
- /^\d+\.\d+$/ | ||
|
||
matrix: | ||
allow_failures: | ||
- php: nightly | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
before_install: | ||
- if [[ "$TRAVIS_PHP_VERSION" != "5.6" && "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini || true; fi | ||
- composer selfupdate | ||
|
||
install: composer update --prefer-dist --no-interaction | ||
|
||
script: if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then bin/phpunit --debug --coverage-clover build/logs/clover.xml; else bin/phpunit --debug; fi | ||
|
||
after_success: | ||
- if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then composer require "satooshi/php-coveralls:^1.0" && travis_retry php bin/coveralls -v; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) Overblog | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# PromiseAdapter | ||
|
||
This library tries to create a simple promise adapter standard while waiting for a psr. | ||
It Comes out of the box with adapter for [ReactPhp/Promise](https://github.com/reactphp/promise) and | ||
[Guzzle/Promises](https://github.com/guzzle/promises). | ||
|
||
[![Build Status](https://travis-ci.org/overblog/promise-adapter.svg?branch=master)](https://travis-ci.org/overblog/promise-adapter) | ||
[![Coverage Status](https://coveralls.io/repos/github/overblog/promise-adapter/badge.svg?branch=master)](https://coveralls.io/github/overblog/promise-adapter?branch=master) | ||
[![Latest Stable Version](https://poser.pugx.org/overblog/promise-adapter/version)](https://packagist.org/packages/overblog/promise-adapter) | ||
[![License](https://poser.pugx.org/overblog/promise-adapter/license)](https://packagist.org/packages/overblog/promise-adapter) | ||
|
||
## Installation | ||
|
||
First, install PromiseAdapter using composer. | ||
|
||
```sh | ||
composer require "overblog/promise-adapter" | ||
``` | ||
|
||
# Usage | ||
|
||
see [here](./docs/usage.md) | ||
|
||
## License | ||
|
||
Overblog/PromiseAdapter is released under the [MIT](https://github.com/overblog/promise-adapter/blob/master/LICENSE) license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "overblog/promise-adapter", | ||
"description": "This library tries to create a simple promise adapter standard while waiting for a psr.", | ||
"type": "library", | ||
"keywords": [ | ||
"promise", | ||
"adapter", | ||
"guzzle", | ||
"react" | ||
], | ||
"config" : { | ||
"bin-dir": "bin", | ||
"sort-packages": true | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Overblog\\PromiseAdapter\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Overblog\\PromiseAdapter\\Test\\": "tests/" | ||
} | ||
}, | ||
"require": { | ||
"php": "^5.5|^7.0" | ||
}, | ||
"require-dev": { | ||
"guzzlehttp/promises": "^1.3.0", | ||
"phpunit/phpunit": "^4.1|^5.1", | ||
"react/promise": "^2.5.0" | ||
}, | ||
"suggest": { | ||
"guzzlehttp/promises": "To use with Guzzle promise", | ||
"react/promise": "To use with ReactPhp promise" | ||
}, | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Promise adapter usage | ||
|
||
## Optional requirements | ||
|
||
Optional to use Guzzle: | ||
|
||
```sh | ||
composer require "guzzlehttp/promises" | ||
``` | ||
|
||
Optional to use ReactPhp: | ||
|
||
```sh | ||
composer require "react/promise" | ||
``` | ||
|
||
## Supported Adapter | ||
|
||
*Guzzle*: `Overblog\PromiseAdapter\Adapter\GuzzleHttpPromiseAdapter` | ||
|
||
*ReactPhp*: `Overblog\PromiseAdapter\Adapter\ReactPromiseAdapter` | ||
|
||
To use a custom Promise lib you can implement `Overblog\PromiseAdapter\PromiseAdapterInterface` |
Oops, something went wrong.