Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Guzzle 6 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions SteamApi/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace SteamApi;

use SteamApi\Client;
use SteamApi\Containers\App as AppContainer;
use SteamApi\Interfaces\IApp;

Expand Down Expand Up @@ -92,4 +91,4 @@ protected function convertToObjects($apps)

return $cleanedApps;
}
}
}
9 changes: 5 additions & 4 deletions SteamApi/Client.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php
namespace SteamApi;

use Exception;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ServerException;
use Psr\Http\Message\ResponseInterface;
use SteamApi\Exceptions\ApiArgumentRequiredException;
use SteamApi\Exceptions\ApiCallFailedException;

Expand Down Expand Up @@ -41,7 +42,7 @@ public function buildUrl($version = false)

if ($this->method){
$url .= $this->method . '/';
}
}

if ($version) {
return $url . 'v'. $this->version . '/';
Expand Down Expand Up @@ -112,7 +113,7 @@ public function setUpClient(array $arguments = array()){
return $response->body;
}

public function prepareResponse($response)
public function prepareResponse(ResponseInterface $response)
{
try {
$result = new \stdClass();
Expand All @@ -131,4 +132,4 @@ public function prepareResponse($response)

return $result;
}
}
}
3 changes: 1 addition & 2 deletions SteamApi/News.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace SteamApi;

use SteamApi\Client;
use SteamApi\Interfaces\INews;

class News extends Client implements INews {
Expand All @@ -26,4 +25,4 @@ public function GetNewsForApp($appId, $count = 5, $maxLength = null)

return $client->appnews;
}
}
}
3 changes: 1 addition & 2 deletions SteamApi/Player.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace SteamApi;

use SteamApi\Client;
use SteamApi\Containers\Game;
use SteamApi\Containers\Player\Level;
use SteamApi\Interfaces\IPlayer;
Expand Down Expand Up @@ -171,4 +170,4 @@ protected function convertToObjects($games)

return $cleanedGames;
}
}
}
7 changes: 3 additions & 4 deletions SteamApi/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace SteamApi;

use SteamApi\Interfaces\IUser;
use SteamApi\Client;

class User extends Client implements IUser {
protected $interface = 'ISteamUser';
Expand Down Expand Up @@ -38,10 +37,10 @@ public function GetPlayerBans($steamId = null){
$client = $this->setUpClient($arguments);

$bans = $this->convertToObjects($client->players, '\SteamApi\Containers\Player\Bans');

return count($bans) === 1 ? $bans[0] : $bans;
}

public function GetPlayerSummaries($steamId = null)
{
// Set up the api details
Expand Down Expand Up @@ -141,4 +140,4 @@ protected function convertToObjects($players, $class = '\SteamApi\Containers\Pla

return $cleanedPlayers;
}
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
]
},
"require": {
"guzzlehttp/guzzle": "5.0.*@dev"
"guzzlehttp/guzzle": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "4.6.*@dev"
}
}
}
Loading