Total Complexity | 6 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class NamedVolume extends Volume |
||
8 | { |
||
9 | /** @var string */ |
||
10 | private $target; |
||
11 | /** @var bool|null */ |
||
12 | protected $readOnly; |
||
13 | |||
14 | /** |
||
15 | * BindVolume constructor. |
||
16 | * @param string $source |
||
17 | * @param bool|null $readOnly |
||
18 | * @param string $target |
||
19 | */ |
||
20 | public function __construct(string $source, string $target, ?bool $readOnly) |
||
21 | { |
||
22 | parent::__construct(VolumeTypeEnum::NAMED_VOLUME, $source); |
||
23 | $this->target = $target; |
||
24 | $this->readOnly = $readOnly; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return string |
||
29 | */ |
||
30 | public function getTarget(): string |
||
31 | { |
||
32 | return $this->target; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param string $target |
||
37 | */ |
||
38 | public function setTarget(string $target): void |
||
39 | { |
||
40 | $this->target = $target; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return bool|null |
||
45 | */ |
||
46 | public function isReadOnly(): ?bool |
||
47 | { |
||
48 | return $this->readOnly; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param bool|null $readOnly |
||
53 | */ |
||
54 | public function setReadOnly(?bool $readOnly): void |
||
55 | { |
||
56 | $this->readOnly = $readOnly; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Specify data which should be serialized to JSON |
||
61 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
62 | * @return array data which can be serialized by <b>json_encode</b>, |
||
63 | * which is a value of any type other than a resource. |
||
64 | * @since 5.4.0 |
||
65 | */ |
||
66 | public function jsonSerialize(): array |
||
73 | ); |
||
74 | } |
||
75 | } |
||
76 |