Completed
Pull Request — Laravel4 (#36)
by
unknown
10:35
created

News::GetNewsForApp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

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