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

News   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A GetNewsForApp() 0 18 2
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
}