Skip to content

Commit c7652d5

Browse files
authored
Merge pull request #97 from syntaxerrors/issue-96-replace-nukacode
Issue-96: Replace NukaCode Database with native Laravel collections
2 parents 82f5dca + 0b208cf commit c7652d5

File tree

13 files changed

+103
-151
lines changed

13 files changed

+103
-151
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"require": {
1313
"php": "^7.2.0",
1414
"laravel/framework": ">=5.8.0",
15-
"guzzlehttp/guzzle": "^6.0",
16-
"nukacode/database": "^1.0"
15+
"guzzlehttp/guzzle": "^6.0"
1716
},
1817
"require-dev": {
1918
"phpunit/phpunit": "^8.0",

composer.lock

Lines changed: 80 additions & 127 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/app/appDetails.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Array
2222
)
2323

2424
[legal] => None
25-
[developers] => NukaCode\Database\Collection Object
25+
[developers] => Illuminate\Support\Collection Object
2626
(
2727
[items:protected] => Array
2828
(
@@ -31,7 +31,7 @@ Array
3131

3232
)
3333

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

64-
[categories] => NukaCode\Database\Collection Object
64+
[categories] => Illuminate\Support\Collection Object
6565
(
6666
[items:protected] => Array
6767
(
@@ -135,7 +135,7 @@ Array
135135

136136
)
137137

138-
[genres] => NukaCode\Database\Collection Object
138+
[genres] => Illuminate\Support\Collection Object
139139
(
140140
[items:protected] => Array
141141
(
@@ -239,7 +239,7 @@ Array
239239

240240
)
241241

242-
[dlc] => NukaCode\Database\Collection Object
242+
[dlc] => Illuminate\Support\Collection Object
243243
(
244244
[items:protected] => Array
245245
(

src/Syntax/SteamApi/Containers/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Syntax\SteamApi\Containers;
44

5-
use NukaCode\Database\Collection;
5+
use Illuminate\Support\Collection;
66

77
class App extends BaseContainer
88
{

src/Syntax/SteamApi/Containers/BaseContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Syntax\SteamApi\Containers;
44

5-
use NukaCode\Database\Collection;
5+
use Illuminate\Support\Collection;
66

77
abstract class BaseContainer
88
{

src/Syntax/SteamApi/Containers/Group.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Syntax\SteamApi\Containers;
44

55
use Syntax\SteamApi\Client;
6-
use NukaCode\Database\Collection;
6+
use Illuminate\Support\Collection;
77
use Syntax\SteamApi\Containers\Group\Details;
88
use Syntax\SteamApi\Containers\Group\MemberDetails;
99

src/Syntax/SteamApi/Steam/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Syntax\SteamApi\Steam;
44

55
use Syntax\SteamApi\Client;
6-
use NukaCode\Database\Collection;
6+
use Illuminate\Support\Collection;
77
use Syntax\SteamApi\Containers\App as AppContainer;
88

99
class App extends Client

src/Syntax/SteamApi/Steam/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Syntax\SteamApi\Steam;
44

55
use Syntax\SteamApi\Client;
6-
use NukaCode\Database\Collection;
6+
use Illuminate\Support\Collection;
77
use Syntax\SteamApi\Containers\Item as ItemContainer;
88
use Syntax\SteamApi\Exceptions\ApiCallFailedException;
99
use Syntax\SteamApi\Inventory;

src/Syntax/SteamApi/Steam/Package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Syntax\SteamApi\Steam;
44

55
use Syntax\SteamApi\Client;
6-
use NukaCode\Database\Collection;
6+
use Illuminate\Support\Collection;
77
use Syntax\SteamApi\Containers\Package as PackageContainer;
88

99
class Package extends Client

src/Syntax/SteamApi/Steam/Player.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Syntax\SteamApi\Steam;
44

55
use Syntax\SteamApi\Client;
6-
use NukaCode\Database\Collection;
6+
use Illuminate\Support\Collection;
77
use Syntax\SteamApi\Containers\Game;
88
use Syntax\SteamApi\Containers\Player\Level;
99

tests/AppTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public function it_gets_a_list_of_all_apps()
3333
private function checkClasses($detail)
3434
{
3535
$this->assertInstanceOf('Syntax\SteamApi\Containers\App', $detail);
36-
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->developers);
37-
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->publishers);
38-
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->categories);
39-
$this->assertInstanceOf('NukaCode\Database\Collection', $detail->genres);
36+
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->developers);
37+
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->publishers);
38+
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->categories);
39+
$this->assertInstanceOf('Illuminate\Support\Collection', $detail->genres);
4040
}
4141
}

tests/GroupTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function checkClasses($group)
2929
$this->assertInstanceOf('Syntax\SteamApi\Containers\Group', $group);
3030
$this->assertInstanceOf('Syntax\SteamApi\Containers\Group\Details', $group->groupDetails);
3131
$this->assertInstanceOf('Syntax\SteamApi\Containers\Group\MemberDetails', $group->memberDetails);
32-
$this->assertInstanceOf('NukaCode\Database\Collection', $group->members);
32+
$this->assertInstanceOf('Illuminate\Support\Collection', $group->members);
3333
}
3434

3535
}

tests/PlayerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function it_gets_the_owned_games_by_user_id()
5757
{
5858
$games = $this->steamClient->player($this->id64)->GetOwnedGames();
5959

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)