Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
ValueOption
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Core\Dto;
3
4use Apie\Core\ValueObjects\Utils;
5
6/**
7 * Used for metadata to show a limited number of options.
8 */
9final class ValueOption implements DtoInterface
10{
11    public readonly string $typehint;
12
13    public readonly string $serializedValue;
14
15    public function __construct(
16        public readonly string $name,
17        public readonly mixed $value
18    ) {
19        $this->typehint = get_debug_type($value);
20        $this->serializedValue = Utils::toString($value);
21    }
22}