Skip to content

Commit d91a7c9

Browse files
author
Felix Stieglitz
committed
Added app 'type' and 'fullgame' properties.
1 parent d4bf460 commit d91a7c9

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/Syntax/SteamApi/Containers/App.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ class App extends BaseContainer
88
{
99
public $id;
1010

11+
public $type;
12+
1113
public $name;
1214

1315
public $controllerSupport;
@@ -16,6 +18,8 @@ class App extends BaseContainer
1618

1719
public $about;
1820

21+
public $fullgame;
22+
1923
public $header;
2024

2125
public $website;
@@ -43,10 +47,12 @@ class App extends BaseContainer
4347
public function __construct($app)
4448
{
4549
$this->id = $app->steam_appid;
50+
$this->type = $app->type;
4651
$this->name = $app->name;
4752
$this->controllerSupport = $this->checkIssetField($app, 'controller_support', 'None');
4853
$this->description = $app->detailed_description;
4954
$this->about = $app->about_the_game;
55+
$this->fullgame = $this->checkIssetField($app, 'fullgame', $this->getFakeFullgameObject());
5056
$this->header = $app->header_image;
5157
$this->website = $this->checkIsNullField($app, 'website', 'None');
5258
$this->pcRequirements = $app->pc_requirements;
@@ -77,4 +83,11 @@ protected function getFakePriceObject()
7783

7884
return $object;
7985
}
86+
87+
protected function getFakeFullgameObject()
88+
{
89+
$object = new \stdClass();
90+
$object->appid = null;
91+
$object->name = 'No parent game found';
92+
}
8093
}

tests/BaseTester.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function checkGroupProperties($group)
101101
private function checkMainAppProperties($app)
102102
{
103103
$attributes = [
104-
'id', 'name', 'controllerSupport', 'description', 'about', 'header', 'website'
104+
'id', 'type', 'name', 'controllerSupport', 'description', 'about', 'fullgame', 'header', 'website'
105105
];
106106
$this->assertObjectHasAttributes($attributes, $app);
107107
}

0 commit comments

Comments
 (0)