Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| MediaContent | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| toArray | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| jsonSerialize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package Modules\Media\Models |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace Modules\Media\Models; |
| 16 | |
| 17 | /** |
| 18 | * Media content class. |
| 19 | * |
| 20 | * @package Modules\Media\Models |
| 21 | * @license OMS License 2.0 |
| 22 | * @link https://jingga.app |
| 23 | * @since 1.0.0 |
| 24 | */ |
| 25 | class MediaContent implements \JsonSerializable |
| 26 | { |
| 27 | /** |
| 28 | * ID. |
| 29 | * |
| 30 | * @var int |
| 31 | * @since 1.0.0 |
| 32 | */ |
| 33 | public int $id = 0; |
| 34 | |
| 35 | /** |
| 36 | * Content of the media. |
| 37 | * |
| 38 | * @var string |
| 39 | * @since 1.0.0 |
| 40 | */ |
| 41 | public string $content = ''; |
| 42 | |
| 43 | /** |
| 44 | * {@inheritdoc} |
| 45 | */ |
| 46 | public function toArray() : array |
| 47 | { |
| 48 | return [ |
| 49 | 'id' => $this->id, |
| 50 | 'content' => $this->content, |
| 51 | ]; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * {@inheritdoc} |
| 56 | */ |
| 57 | public function jsonSerialize() : mixed |
| 58 | { |
| 59 | return $this->toArray(); |
| 60 | } |
| 61 | } |