Skip to content

Commit

Permalink
Merge pull request #97 from syntaxerrors/issue-96-replace-nukacode
Browse files Browse the repository at this point in the history
Issue-96: Replace NukaCode Database with native Laravel collections
  • Loading branch information
nicekiwi authored Oct 9, 2019
2 parents 82f5dca + 0b208cf commit c7652d5
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 151 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"require": {
"php": "^7.2.0",
"laravel/framework": ">=5.8.0",
"guzzlehttp/guzzle": "^6.0",
"nukacode/database": "^1.0"
"guzzlehttp/guzzle": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
Expand Down
207 changes: 80 additions & 127 deletions composer.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/app/appDetails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Array
)

[legal] => None
[developers] => NukaCode\Database\Collection Object
[developers] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
Expand All @@ -31,7 +31,7 @@ Array

)

[publishers] => NukaCode\Database\Collection Object
[publishers] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
Expand Down Expand Up @@ -61,7 +61,7 @@ Array
[url] => http://www.metacritic.com/game/pc/portal-2?ftag=MCD-06-10aaa1f
)

[categories] => NukaCode\Database\Collection Object
[categories] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
Expand Down Expand Up @@ -135,7 +135,7 @@ Array

)

[genres] => NukaCode\Database\Collection Object
[genres] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
Expand Down Expand Up @@ -239,7 +239,7 @@ Array

)

[dlc] => NukaCode\Database\Collection Object
[dlc] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
Expand Down
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Containers/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Syntax\SteamApi\Containers;

use NukaCode\Database\Collection;
use Illuminate\Support\Collection;

class App extends BaseContainer
{
Expand Down
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Containers/BaseContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Syntax\SteamApi\Containers;

use NukaCode\Database\Collection;
use Illuminate\Support\Collection;

abstract class BaseContainer
{
Expand Down
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Containers/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Syntax\SteamApi\Containers;

use Syntax\SteamApi\Client;
use NukaCode\Database\Collection;
use Illuminate\Support\Collection;
use Syntax\SteamApi\Containers\Group\Details;
use Syntax\SteamApi\Containers\Group\MemberDetails;

Expand Down
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Steam/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Syntax\SteamApi\Steam;

use Syntax\SteamApi\Client;
use NukaCode\Database\Collection;
use Illuminate\Support\Collection;
use Syntax\SteamApi\Containers\App as AppContainer;

class App extends Client
Expand Down
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Steam/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Syntax\SteamApi\Steam;

use Syntax\SteamApi\Client;
use NukaCode\Database\Collection;
use Illuminate\Support\Collection;
use Syntax\SteamApi\Containers\Item as ItemContainer;
use Syntax\SteamApi\Exceptions\ApiCallFailedException;
use Syntax\SteamApi\Inventory;
Expand Down
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Steam/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Syntax\SteamApi\Steam;

use Syntax\SteamApi\Client;
use NukaCode\Database\Collection;
use Illuminate\Support\Collection;
use Syntax\SteamApi\Containers\Package as PackageContainer;

class Package extends Client
Expand Down
2 changes: 1 addition & 1 deletion src/Syntax/SteamApi/Steam/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Syntax\SteamApi\Steam;

use Syntax\SteamApi\Client;
use NukaCode\Database\Collection;
use Illuminate\Support\Collection;
use Syntax\SteamApi\Containers\Game;
use Syntax\SteamApi\Containers\Player\Level;

Expand Down
8 changes: 4 additions & 4 deletions tests/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public function it_gets_a_list_of_all_apps()
private function checkClasses($detail)
{
$this->assertInstanceOf('Syntax\SteamApi\Containers\App', $detail);
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->developers);
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->publishers);
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->categories);
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->genres);
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->developers);
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->publishers);
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->categories);
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->genres);
}
}
2 changes: 1 addition & 1 deletion tests/GroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected function checkClasses($group)
$this->assertInstanceOf('Syntax\SteamApi\Containers\Group', $group);
$this->assertInstanceOf('Syntax\SteamApi\Containers\Group\Details', $group->groupDetails);
$this->assertInstanceOf('Syntax\SteamApi\Containers\Group\MemberDetails', $group->memberDetails);
$this->assertInstanceOf('NukaCode\Database\Collection', $group->members);
$this->assertInstanceOf('Illuminate\Support\Collection', $group->members);
}

}
10 changes: 5 additions & 5 deletions tests/PlayerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function it_gets_the_owned_games_by_user_id()
{
$games = $this->steamClient->player($this->id64)->GetOwnedGames();

$this->assertInstanceOf('NukaCode\Database\Collection', $games);
$this->assertInstanceOf('Illuminate\Support\Collection', $games);
$this->assertInstanceOf('Syntax\SteamApi\Containers\Game', $games->first());

$attributes = [
Expand All @@ -72,7 +72,7 @@ public function it_gets_the_owned_games_by_user_id_without_app_details()
{
$games = $this->steamClient->player($this->id64)->GetOwnedGames(false);

$this->assertInstanceOf('NukaCode\Database\Collection', $games);
$this->assertInstanceOf('Illuminate\Support\Collection', $games);
$this->assertInstanceOf('Syntax\SteamApi\Containers\Game', $games->first());

$attributes = [
Expand All @@ -91,7 +91,7 @@ public function it_filters_the_owned_games_by_user_id()
{
$games = $this->steamClient->player($this->id64)->GetOwnedGames(true, false, $this->appId);

$this->assertInstanceOf('NukaCode\Database\Collection', $games);
$this->assertInstanceOf('Illuminate\Support\Collection', $games);
$this->assertInstanceOf('Syntax\SteamApi\Containers\Game', $games->first());
$this->assertEquals(1, $games->count());

Expand All @@ -107,7 +107,7 @@ public function it_gets_recently_played_games_by_user_id()
{
$games = $this->steamClient->player($this->id64)->GetRecentlyPlayedGames();

$this->assertInstanceOf('NukaCode\Database\Collection', $games);
$this->assertInstanceOf('Illuminate\Support\Collection', $games);
$this->assertInstanceOf('Syntax\SteamApi\Containers\Game', $games->first());

$attributes = [
Expand All @@ -122,7 +122,7 @@ public function it_gets_a_single_recently_played_game_by_user_id()
{
$games = $this->steamClient->player($this->id64)->GetRecentlyPlayedGames(1);

$this->assertInstanceOf('NukaCode\Database\Collection', $games);
$this->assertInstanceOf('Illuminate\Support\Collection', $games);
$this->assertInstanceOf('Syntax\SteamApi\Containers\Game', $games->first());
$this->assertEquals(1, $games->count());

Expand Down

0 comments on commit c7652d5

Please sign in to comment.