Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| CustomFieldsBase64Json | |
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getRawData | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Satag\AmicronEntityBundle\Util\CustomFields; |
| 4 | |
| 5 | class CustomFieldsBase64Json extends CustomFieldsJson |
| 6 | { |
| 7 | public function __construct(object $entity, string $fieldName, string $dataIdentifier) |
| 8 | { |
| 9 | parent::__construct($entity, $fieldName, $dataIdentifier); |
| 10 | $this->setEncoder(new CustomFieldsBase64EncoderJson($dataIdentifier)); |
| 11 | } |
| 12 | |
| 13 | #[\Override] |
| 14 | protected function getRawData(): string |
| 15 | { |
| 16 | return (string) base64_decode((string) $this->entity->{$this->getter}(), true); |
| 17 | } |
| 18 | /* |
| 19 | protected function setRawData(string $data): void |
| 20 | { |
| 21 | $this->entity->{$this->setter}(base64_encode($data)); |
| 22 | } |
| 23 | */ |
| 24 | } |