Completed
Pull Request — master (#37)
by Mahmoud
08:04
created

News::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php namespace Syntax\SteamApi\Steam;
2
3
use Syntax\SteamApi\Client;
4
5
class News extends Client {
6
7 2
	public function __construct()
8
	{
9 2
		parent::__construct();
10 2
		$this->interface = 'ISteamNews';
11 2
	}
12
13 2
	public function GetNewsForApp($appId, $count = 5, $maxLength = null)
14
	{
15
		// Set up the api details
16 2
		$this->method     = __FUNCTION__;
17 2
		$this->version    = 'v0002';
18
19
		// Set up the arguments
20
		$arguments = [
21 2
			'appid' => $appId,
22
			'count' => $count
23 2
		];
24 2
		if (!is_null($maxLength)) $arguments['maxlength'] = $maxLength;
25
26
		// Get the client
27 2
		$client = $this->setUpClient($arguments);
28
29
		return $client->appnews;
30
	}
31
}