Skip to content

Commit e2fa506

Browse files
authored
Merge pull request #16 from ethanpooley/php-dependencies_ep
Require higher versions of PHP and PHPUnit
2 parents cb5115d + 3f03c9f commit e2fa506

File tree

6 files changed

+24
-21
lines changed

6 files changed

+24
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/working
33
/logs
44
composer.lock
5+
composer.phar

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ sudo: false
55
language: php
66

77
php:
8-
- 5.6
9-
- 7.0
8+
- 7.1
9+
- 7.2
10+
# - 7.3 Affected by https://bugs.xdebug.org/view.php?id=1903
11+
- 7.4
1012

1113
install:
1214
- composer install

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
A PHP client for the Heroku Platform API, similar to [platform-api](https://github.com/heroku/platform-api) for Ruby and [node-heroku-client](https://github.com/heroku/node-heroku-client) for Node.js. With it you can create and alter Heroku apps, install or remove add-ons, scale resources up and down, and use any other capabilities documented by the [Platform API Reference](https://devcenter.heroku.com/articles/platform-api-reference).
1010

1111
## Features
12-
- Reads `HEROKU_API_KEY` for zero-config use
12+
- Reads `HEROKU_API_KEY` for zero-config use (deprecated)
1313
- Returns JSON-decoded Heroku API responses
1414
- Exposes response headers (necessary for some API functionality)
1515
- Uses a built-in cURL-based HTTP client or one that you provide
1616
- Accepts cURL options and custom request headers
1717
- Throws informative exceptions for authentication, JSON, and HTTP errors
18-
- Designed around [PSR-7](http://www.php-fig.org/psr/psr-7/) (Request/Response) and [HTTPlug](http://docs.php-http.org/en/latest/httplug/introduction.html) (HttpClient) interfaces
18+
- Designed around the [PSR-7](http://www.php-fig.org/psr/psr-7/) (Request/Response) and [PSR-18](https://www.php-fig.org/psr/psr-18/) (HTTP client) standards
1919

2020
## Requirements
21-
- PHP 5.6 / 7
21+
- PHP 7.1+ (For PHP 5.6 or 7.0 use our 1.x branch)
2222
- cURL, unless providing an HTTP client without cURL dependencies (such as [Socket Client](http://docs.php-http.org/en/latest/clients/socket-client.html))
2323

2424
## Installation
@@ -34,7 +34,7 @@ require_once __DIR__ . '/vendor/autoload.php';
3434
use HerokuClient\Client as HerokuClient;
3535

3636
$heroku = new HerokuClient([
37-
'apiKey' => 'my-api-key', // Or set the HEROKU_API_KEY environmental variable
37+
'apiKey' => 'my-api-key',
3838
]);
3939
```
4040
Find out how many web dynos are currently running:
@@ -59,9 +59,9 @@ $remainingCalls = $heroku->getLastHttpResponse()->getHeaderLine('RateLimit-Remai
5959
The client can be configured at instantiation with these settings, all of which are optional and have sane defaults:
6060
```php
6161
new HerokuClient([
62-
'apiKey' => 'my-api-key', // If not set, the client finds HEROKU_API_KEY or fails
62+
'apiKey' => 'my-api-key', // If not set, the client finds HEROKU_API_KEY (deprecated) or fails
6363
'baseUrl' => 'http://custom.base.url/', // Defaults to https://api.heroku.com/
64-
'httpClient' => $myFavoriteHttpClient, // Any client implementing HTTPlug's HttpClient interface
64+
'httpClient' => $myFavoriteHttpClient, // Any PSR-18 compatible HTTP client
6565
'curlOptions' => [ // Options can be set when using the default HTTP client
6666
CURLOPT_TIMEOUT => 10,
6767
CURLOPT_USERAGENT => 'My Agent',
@@ -114,7 +114,7 @@ try {
114114
- `JsonEncodingException`
115115
- `MissingApiKeyException`
116116

117-
In addition to exceptions thrown directly from this API client, [standardized exceptions](http://docs.php-http.org/en/latest/httplug/exceptions.html) may bubble up from the HTTPlug client implementation in use.
117+
In addition to exceptions thrown directly from this API client, [standardized exceptions](https://www.php-fig.org/psr/psr-18/#clientexceptioninterface) may bubble up from the HTTP client.
118118

119119
## Contributing
120120
Pull Requests are welcome. Please see our [Contribution Guidelines](CONTRIBUTING.md).

composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^5.6 || ^7.0",
16+
"php": "^7.1",
1717
"guzzlehttp/psr7": "^1.0",
1818
"php-http/message": "^1.5",
19-
"php-http/curl-client": "^1.7",
20-
"psr/http-message": "^1.0"
19+
"php-http/curl-client": "^2.1",
20+
"psr/http-message": "^1.0",
21+
"http-interop/http-factory-guzzle": "^1.0"
2122
},
2223
"require-dev": {
2324
"php-http/mock-client": "^1.0",
2425
"ext-curl": "*",
2526
"ext-mbstring": "*",
26-
"phpunit/phpunit": "^5.7",
27-
"phpunit/php-code-coverage": "^4.0"
27+
"phpunit/phpunit": "^7.0",
28+
"phpunit/php-code-coverage": "^6.0.7"
2829
},
2930
"autoload": {
3031
"psr-4": {

phpunit.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false">
10+
stopOnFailure="false">
1211
<testsuites>
1312
<testsuite name="All">
1413
<directory suffix=".php">./tests/</directory>

src/Client.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use HerokuClient\Exception\MissingApiKeyException;
1010
use Http\Client\Curl\Client as CurlHttpClient;
1111
use Http\Client\HttpClient;
12-
use Http\Message\MessageFactory\GuzzleMessageFactory;
13-
use Http\Message\StreamFactory\GuzzleStreamFactory;
12+
use Http\Factory\Guzzle\ResponseFactory;
13+
use Http\Factory\Guzzle\StreamFactory;
1414
use Psr\Http\Message\RequestInterface;
1515
use Psr\Http\Message\ResponseInterface;
1616

@@ -38,7 +38,7 @@ class Client
3838
protected $curlOptions = [];
3939

4040
/**
41-
* @var HttpClient $httpClient Client implementing the HTTPlug interface
41+
* @var HttpClient $httpClient PSR-18 HTTP client
4242
*/
4343
protected $httpClient;
4444

@@ -261,8 +261,8 @@ protected function processResponse(ResponseInterface $httpResponse)
261261
protected function buildHttpClient()
262262
{
263263
return new CurlHttpClient(
264-
new GuzzleMessageFactory(),
265-
new GuzzleStreamFactory(),
264+
new ResponseFactory(),
265+
new StreamFactory(),
266266
$this->curlOptions
267267
);
268268
}

0 commit comments

Comments
 (0)