News   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 30
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

2 Methods

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