Completed
Pull Request — master (#35)
by
unknown
06:53
created

News::GetNewsForApp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2.0078

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
ccs 7
cts 8
cp 0.875
rs 9.4285
cc 2
eloc 9
nc 2
nop 3
crap 2.0078
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
}