Completed
Pull Request — master (#96)
by
unknown
04:20 queued 03:05
created

Memory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
// Copyright 1999-2021. Plesk International GmbH.
3
4
namespace PleskX\Api\Struct\Server\Statistics;
5
6
class Memory extends \PleskX\Api\Struct
7
{
8
    /** @var int */
9
    public $totalMemory;
10
11
    /** @var int */
12
    public $usedMemory;
13
14
    /** @var int */
15
    public $freeMemory;
16
17
    /** @var int */
18
    public $sharedMemory;
19
20
    /** @var int */
21
    public $bufferMemory;
22
23
    /** @var int */
24
    public $cachedMemory;
25
26
    public function __construct($apiResponse)
27
    {
28
        $this->_initScalarProperties($apiResponse, [
29
            ['total' => 'totalMemory'],
30
            ['used' => 'usedMemory'],
31
            ['free' => 'freeMemory'],
32
            ['shared' => 'sharedMemory'],
33
            ['buffer' => 'bufferMemory'],
34
            ['cached' => 'cachedMemory'],
35
        ]);
36
    }
37
}
38