Skip to content

Commit c0d7443

Browse files
authored
Merge pull request #4
Require PHP 7.2.5 for client interface support
2 parents 983f31f + 0793847 commit c0d7443

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can install the Pterodactyl PHP API into your project using [Composer](https
1717
$ composer require timdesm/pterodactyl-php-api
1818
```
1919

20-
This project requires PHP version `5.6.4` or `later`.
20+
This project requires PHP version `7.2.5` or `later`.
2121

2222
## Usage
2323

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">=5.6.4",
21+
"php": ">=7.2.5",
2222
"guzzlehttp/guzzle": "^6.0|^7.0"
2323
},
2424
"require-dev": {

src/Http.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Timdesm\PterodactylPhpApi;
44

55
use GuzzleHttp\Client;
6+
use GuzzleHttp\ClientInterface;
67
use Timdesm\PterodactylPhpApi\Exceptions\AccessDeniedHttpException;
78
use Timdesm\PterodactylPhpApi\Exceptions\FailedActionException;
89
use Timdesm\PterodactylPhpApi\Exceptions\NotFoundException;
@@ -43,7 +44,7 @@ class Http
4344
/**
4445
* The GuzzleHttp client.
4546
*
46-
* @var Client
47+
* @var ClientInterface
4748
*/
4849
protected $guzzle;
4950

@@ -54,7 +55,13 @@ class Http
5455
*/
5556
public $timeout = 30;
5657

57-
public function __construct(PterodactylApi $pterodactyl, Client $guzzle = null)
58+
/**
59+
* Create a new HTTP transport instance.
60+
*
61+
* @param PterodactylApi $pterodactyl
62+
* @param ClientInterface|null $guzzle
63+
*/
64+
public function __construct(PterodactylApi $pterodactyl, ?ClientInterface $guzzle = null)
5865
{
5966
$this->pterodactyl = $pterodactyl;
6067

src/PterodactylApi.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Timdesm\PterodactylPhpApi;
44

5-
use GuzzleHttp\Client as Client;
5+
use GuzzleHttp\ClientInterface;
66
use Timdesm\PterodactylPhpApi\Http;
77
use Timdesm\PterodactylPhpApi\Exceptions\InvaildApiTypeException;
88
use Timdesm\PterodactylPhpApi\Managers\AccountManager;
@@ -143,12 +143,12 @@ class PterodactylApi
143143
/**
144144
* Create a new PterodactylApi instance.
145145
*
146-
* @param string $apiKey
147-
* @param \GuzzleHttp\Client $guzzle
146+
* @param string $apiKey
147+
* @param ClientInterface|null $guzzle
148148
*
149149
* @return void
150150
*/
151-
public function __construct($baseUri, $apiKey, $apiType = 'application', Client $guzzle = null)
151+
public function __construct($baseUri, $apiKey, $apiType = 'application', ?ClientInterface $guzzle = null)
152152
{
153153
$this->baseUri = $baseUri;
154154
$this->apiKey = $apiKey;

0 commit comments

Comments
 (0)