1 | <?php |
||
10 | class ValueWrapper implements ValueWrapperInterface |
||
11 | { |
||
12 | /** |
||
13 | * The storage variable containing the type mappings. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | public static $typeMappingRegistry = [ |
||
18 | 'string' => \drupol\valuewrapper\Type\StringType::class, |
||
19 | 'array' => \drupol\valuewrapper\Type\ArrayType::class, |
||
20 | 'null' => \drupol\valuewrapper\Type\NullType::class, |
||
21 | 'boolean' => \drupol\valuewrapper\Type\BooleanType::class, |
||
22 | 'integer' => \drupol\valuewrapper\Type\IntegerType::class, |
||
23 | 'double' => \drupol\valuewrapper\Type\DoubleType::class, |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * The storage variable containing the object mappings. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | public static $objectMappingRegistry = [ |
||
32 | 'stdClass' => \drupol\valuewrapper\Object\StdClassObject::class, |
||
33 | 'Anonymous' => \drupol\valuewrapper\Object\AnonymousObject::class, |
||
34 | 'Closure' => \drupol\valuewrapper\Object\ClosureObject::class, |
||
35 | 'DateTime' => \drupol\valuewrapper\Object\DateTimeObject::class, |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * The storage variable containing the resource mappings. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | public static $resourceMappingRegistry = [ |
||
44 | 'stream' => \drupol\valuewrapper\Resource\StreamResource::class, |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | 3 | public static function create($value) : ValueInterface |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | 16 | public function make($value) : ValueInterface |
|
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 16 | protected function getType($value) : string |
|
102 | } |
||
103 |