1 | <?php |
||
10 | * Trait for parameters having a string value. |
||
11 | */ |
||
12 | trait StringParameterValue |
||
13 | { |
||
14 | /** |
||
15 | * Constructor. |
||
16 | * |
||
17 | * @param string $value Parameter value |
||
18 | */ |
||
19 | abstract public function __construct(string $value); |
||
20 | |||
21 | /** |
||
22 | * Initialize from a JSON value. |
||
23 | * |
||
24 | * @param string $value |
||
25 | * |
||
26 | * @return static |
||
27 | */ |
||
28 | 101 | public static function fromJSONValue($value): Parameter |
|
29 | { |
||
30 | 101 | return new static(strval($value)); |
|
33 |