Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
BinaryStream
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getSchema
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Core\ValueObjects;
3
4use Apie\Core\Attributes\CmsSingleInput;
5use Apie\Core\Attributes\Description;
6use Apie\Core\Attributes\SchemaMethod;
7use Apie\Core\Dto\CmsInputOption;
8use Apie\Core\Enums\FileStreamType;
9use 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))]
14final 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}