PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 3.3.1
WP STAGING – WordPress Backup, Restore, Migration & Clone v3.3.1
4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / Backup / Dto / AbstractDto.php
wp-staging / Backup / Dto Last commit date
Interfaces 2 years ago Job 2 years ago Service 2 years ago Task 2 years ago Traits 2 years ago AbstractDto.php 3 years ago AbstractTaskDto.php 2 years ago JobDataDto.php 2 years ago StepsDto.php 2 years ago TaskResponseDto.php 2 years ago
AbstractDto.php
55 lines
1 <?php
2
3 // TODO PHP7.x declare(strict_types=1);
4 // TODO PHP7.x type-hints & return types
5
6 namespace WPStaging\Backup\Dto;
7
8 use JsonSerializable;
9 use Serializable;
10 use WPStaging\Framework\Interfaces\ArrayableInterface;
11 use WPStaging\Framework\Traits\ArrayableTrait;
12 use WPStaging\Framework\Traits\HydrateTrait;
13
14 abstract class AbstractDto implements JsonSerializable, Serializable, ArrayableInterface
15 {
16 use ArrayableTrait;
17 use HydrateTrait;
18
19 /**
20 * @inheritDoc
21 */
22 public function serialize()
23 {
24 return serialize($this->toArray());
25 }
26
27 public function __serialize()
28 {
29 return $this->toArray();
30 }
31
32 /**
33 * @inheritDoc
34 */
35 public function unserialize($serialized)
36 {
37 $this->hydrate(unserialize($serialized));
38 }
39
40 public function __unserialize($serialized)
41 {
42 return $this->hydrate($serialized);
43 }
44
45 /**
46 * @inheritDoc
47 *
48 */
49 #[\ReturnTypeWillChange]
50 public function jsonSerialize()
51 {
52 return $this->toArray();
53 }
54 }
55