Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
8 | class CimLogicalDisk extends CimStorageExtent |
||
9 | { |
||
10 | protected $byte_suffixes = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB']; |
||
11 | |||
12 | protected $uuid = '{8502C539-5FBB-11D2-AAC1-006008C78BC7}'; |
||
13 | |||
14 | protected $freeSpace; |
||
15 | |||
16 | protected $size; |
||
17 | |||
18 | protected $hidden_attributes = ['byte_suffixes']; |
||
19 | |||
20 | protected $attribute_casting = [ |
||
21 | 'freeSpace' => 'int', |
||
22 | 'size' => 'int', |
||
23 | ]; |
||
24 | |||
25 | public function getFreeSpace(int $decimal_places = 2, array $byte_suffixes = null) |
||
26 | { |
||
27 | return $this->convertBytes($this->getAttribute('freeSpace'), $decimal_places, $byte_suffixes); |
||
28 | } |
||
29 | |||
30 | public function getSize(int $decimal_places = 2, array $byte_suffixes = null) |
||
31 | { |
||
32 | return $this->convertBytes($this->getAttribute('size'), $decimal_places, $byte_suffixes); |
||
33 | } |
||
34 | |||
35 | protected function convertBytes($bytes, int $decimal_places = 2, array $byte_suffixes = null) |
||
41 | } |
||
42 | } |
||
43 |