Completed
Pull Request — master (#110)
by
unknown
01:32
created

News::GetNewsForApp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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