Package   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 36
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
A getFakePriceObject() 0 6 1
1
<?php
2
3
namespace Syntax\SteamApi\Containers;
4
5
class Package extends BaseContainer
6
{
7
    public $id;
8
    public $name;
9
    public $page_image;
10
    public $header;
11
    public $small_logo;
12
    public $apps;
13
    public $page_content;
14
    public $price;
15
    public $platforms;
16
    public $release;
17
    private $controller;
18
19 1
    public function __construct($package, $id)
20
    {
21 1
        $this->id = (int) $id;
22 1
        $this->name = $package->name;
23 1
        $this->apps = $package->apps;
24 1
        $this->page_content = $this->checkIssetField($package, 'page_content', 'none');
25 1
        $this->header = $this->checkIssetField($package, 'header_image', 'none');
26 1
        $this->small_logo = $this->checkIssetField($package, 'small_logo', 'none');
27 1
        $this->page_image = $this->checkIssetField($package, 'page_image', 'none');
28 1
        $this->price = $this->checkIssetField($package, 'price', $this->getFakePriceObject());
29 1
        $this->platforms = $package->platforms;
30 1
        $this->controller = $package->controller;
31 1
        $this->release = $package->release_date;
32 1
    }
33
34 1
    protected function getFakePriceObject()
35
    {
36 1
        $object        = new \stdClass();
37 1
        $object->final = 'No price found';
38 1
        return $object;
39
    }
40
}
41