Skip to content

Commit

Permalink
switch to spatie/laravel-data DTOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Nov 9, 2022
1 parent 218711d commit a449307
Show file tree
Hide file tree
Showing 36 changed files with 107 additions and 396 deletions.
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
"role": "Developer"
}
],
"homepage": "https://github.com/Astrotomic/steam-sdk",
"support": {
"issues": "https://github.com/Astrotomic/steam-sdk/issues",
"source": "https://github.com/Astrotomic/steam-sdk",
"docs": "https://docs.ecologi.com/docs/public-api-docs"
},
"funding": [
{
"type": "github",
Expand All @@ -32,6 +26,7 @@
"illuminate/support": "^9.0",
"sammyjo20/saloon": "^1.5.2",
"sammyjo20/saloon-laravel": "^1.5.0",
"spatie/laravel-data": "^2.0",
"xpaw/steamid": "^2.0"
},
"require-dev": {
Expand Down
15 changes: 0 additions & 15 deletions src/Collections/AchievementPercentageCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/ApiInterfaceCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/ApiMethodCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/ApiParameterCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/AppCollection.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Collections/Collection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/FriendCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/LocationCityCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/LocationCountryCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/LocationStateCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/NewsItemCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/PlayerBanCollection.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Collections/PlayerSummaryCollection.php

This file was deleted.

4 changes: 3 additions & 1 deletion src/Data/AchievementPercentage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Astrotomic\SteamSdk\Data;

final class AchievementPercentage extends DataTransferObject
use Spatie\LaravelData\Data;

final class AchievementPercentage extends Data
{
public function __construct(
public readonly string $name,
Expand Down
9 changes: 6 additions & 3 deletions src/Data/ApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

namespace Astrotomic\SteamSdk\Data;

use Astrotomic\SteamSdk\Collections\ApiMethodCollection;
use Spatie\LaravelData\Attributes\DataCollectionOf;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\DataCollection;

final class ApiInterface extends DataTransferObject
final class ApiInterface extends Data
{
public function __construct(
public readonly string $name,
public readonly ApiMethodCollection $methods,
#[DataCollectionOf(ApiMethod::class)]
public readonly DataCollection $methods,
) {
}
}
9 changes: 6 additions & 3 deletions src/Data/ApiMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

namespace Astrotomic\SteamSdk\Data;

use Astrotomic\SteamSdk\Collections\ApiParameterCollection;
use Spatie\LaravelData\Attributes\DataCollectionOf;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\DataCollection;

final class ApiMethod extends DataTransferObject
final class ApiMethod extends Data
{
public function __construct(
public readonly string $name,
public readonly int $version,
public readonly string $httpmethod,
public readonly ApiParameterCollection $parameters,
#[DataCollectionOf(ApiParameter::class)]
public readonly DataCollection $parameters,
) {
}
}
4 changes: 3 additions & 1 deletion src/Data/ApiParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Astrotomic\SteamSdk\Data;

final class ApiParameter extends DataTransferObject
use Spatie\LaravelData\Data;

final class ApiParameter extends Data
{
public function __construct(
public readonly string $name,
Expand Down
4 changes: 3 additions & 1 deletion src/Data/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Astrotomic\SteamSdk\Data;

final class App extends DataTransferObject
use Spatie\LaravelData\Data;

final class App extends Data
{
public function __construct(
public readonly int $appid,
Expand Down
Loading

0 comments on commit a449307

Please sign in to comment.