| Total Complexity | 8 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | final class JsonData implements Data |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var mixed |
||
| 11 | */ |
||
| 12 | private $data; |
||
| 13 | |||
| 14 | private ContentEncoding $contentEncoding; |
||
| 15 | |||
| 16 | private function __construct($data, ContentEncoding $contentEncoding) |
||
| 17 | { |
||
| 18 | $this->data = $data; |
||
| 19 | $this->contentEncoding = $contentEncoding; |
||
| 20 | } |
||
| 21 | |||
| 22 | public static function fromString(string $data, ContentEncoding $contentEncoding) : self |
||
| 23 | { |
||
| 24 | return new self($data, $contentEncoding); |
||
| 25 | } |
||
| 26 | |||
| 27 | public static function fromInteger(int $data, ContentEncoding $contentEncoding) : self |
||
| 28 | { |
||
| 29 | return new self($data, $contentEncoding); |
||
| 30 | } |
||
| 31 | |||
| 32 | public static function fromBoolean(bool $data, ContentEncoding $contentEncoding) : self |
||
| 33 | { |
||
| 34 | return new self($data, $contentEncoding); |
||
| 35 | } |
||
| 36 | |||
| 37 | public static function fromArray(array $data, ContentEncoding $contentEncoding) : self |
||
| 40 | } |
||
| 41 | |||
| 42 | public function getContentType() : ContentType |
||
| 43 | { |
||
| 44 | return new ContentType('application/json'); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function getContentEncoding() : ContentEncoding |
||
| 48 | { |
||
| 49 | return $this->contentEncoding; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function getData() |
||
| 55 | } |
||
| 56 | } |
||
| 57 |