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 | '*' => \drupol\valuewrapper\Type\TypeValue::class, |
||
19 | 'string' => \drupol\valuewrapper\Type\StringType::class, |
||
20 | 'array' => \drupol\valuewrapper\Type\ArrayType::class, |
||
21 | 'null' => \drupol\valuewrapper\Type\NullType::class, |
||
22 | 'boolean' => \drupol\valuewrapper\Type\BooleanType::class, |
||
23 | 'integer' => \drupol\valuewrapper\Type\IntegerType::class, |
||
24 | 'double' => \drupol\valuewrapper\Type\DoubleType::class, |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * The storage variable containing the object mappings. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | public static $objectMappingRegistry = [ |
||
33 | '*' => \drupol\valuewrapper\Object\ObjectValue::class, |
||
34 | 'stdClass' => \drupol\valuewrapper\Object\StdClassObject::class, |
||
35 | 'Anonymous' => \drupol\valuewrapper\Object\AnonymousObject::class, |
||
36 | 'Closure' => \drupol\valuewrapper\Object\ClosureObject::class, |
||
37 | 'DateTime' => \drupol\valuewrapper\Object\DateTimeObject::class, |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * The storage variable containing the resource mappings. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | public static $resourceMappingRegistry = [ |
||
46 | '*' => \drupol\valuewrapper\Resource\ResourceValue::class, |
||
47 | 'stream' => \drupol\valuewrapper\Resource\StreamResource::class, |
||
48 | ]; |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 2 | public static function create($value) : ValueInterface |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 14 | public function make($value) : ValueInterface |
|
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 14 | protected function getType($value) : string |
|
101 | } |
||
102 |