| 1 | <?php |
||
| 24 | abstract class AbstractSerializer implements SerializerInterface |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * @var mixed |
||
| 28 | */ |
||
| 29 | protected $data = null; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * AbstractSerializer constructor. |
||
| 33 | * |
||
| 34 | * @param null|mixed $data |
||
| 35 | */ |
||
| 36 | public function __construct($data = null) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Returns the internal array |
||
| 43 | * |
||
| 44 | * @return mixed|null |
||
| 45 | */ |
||
| 46 | public function getData() |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Sets the data |
||
| 53 | * |
||
| 54 | * @param mixed $data |
||
| 55 | */ |
||
| 56 | public function setData($data): void |
||
| 60 | |||
| 61 | /** |
||
| 62 | * If this returns true, then the data returns back as is |
||
| 63 | * |
||
| 64 | * @param mixed $data |
||
| 65 | * |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | protected function isSerializable($data): bool |
||
| 72 | } |
||
| 73 |