Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| BinaryStream | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| getSchema | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Core\ValueObjects; |
| 3 | |
| 4 | use Apie\Core\Attributes\CmsSingleInput; |
| 5 | use Apie\Core\Attributes\Description; |
| 6 | use Apie\Core\Attributes\SchemaMethod; |
| 7 | use Apie\Core\Dto\CmsInputOption; |
| 8 | use Apie\Core\Enums\FileStreamType; |
| 9 | use Apie\Core\ValueObjects\Interfaces\StringValueObjectInterface; |
| 10 | |
| 11 | #[Description('Represents a binary stream of a file')] |
| 12 | #[SchemaMethod("getSchema")] |
| 13 | #[CmsSingleInput(['stream', 'file'], new CmsInputOption(streamType: FileStreamType::BinaryString))] |
| 14 | final class BinaryStream implements StringValueObjectInterface |
| 15 | { |
| 16 | use IsStringValueObject; |
| 17 | |
| 18 | /** |
| 19 | * @return array<string, string> |
| 20 | */ |
| 21 | public static function getSchema(): array |
| 22 | { |
| 23 | return [ |
| 24 | 'type' => 'string', |
| 25 | 'format' => 'binary' |
| 26 | ]; |
| 27 | } |
| 28 | } |