Completed
Push — master ( 29e67b...7f2aa4 )
by David
14s
created

TmpfsVolume   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A jsonSerialize() 0 5 1
1
<?php
2
3
namespace TheAentMachine\Service\Volume;
4
5
use TheAentMachine\Service\Enum\VolumeTypeEnum;
6
7
class TmpfsVolume extends Volume
8
{
9
    /**
10
     * @return string
11
     */
12
    public static function getType(): string
13
    {
14
        return VolumeTypeEnum::TMPFS_VOLUME;
15
    }
16
17
    /**
18
     * Specify data which should be serialized to JSON
19
     * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
20
     * @return array data which can be serialized by <b>json_encode</b>,
21
     * which is a value of any type other than a resource.
22
     * @since 5.4.0
23
     */
24
    public function jsonSerialize(): array
25
    {
26
        return array(
27
            'type' => self::getType(),
28
            'source' => $this->source,
29
        );
30
    }
31
}
32