1 | <?php |
||
8 | class ValueWrapper implements ValueWrapperInterface |
||
9 | { |
||
10 | /** |
||
11 | * The storage variable containing the mappings. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | private static $typeClassMapping = [ |
||
16 | '*' => \drupol\valuewrapper\Type\TypeValue::class, |
||
17 | 'string' => \drupol\valuewrapper\Type\StringType::class, |
||
18 | 'array' => \drupol\valuewrapper\Type\ArrayType::class, |
||
19 | 'null' => \drupol\valuewrapper\Type\NullType::class, |
||
20 | 'boolean' => \drupol\valuewrapper\Type\BooleanType::class, |
||
21 | 'integer' => \drupol\valuewrapper\Type\IntegerType::class, |
||
22 | 'double' => \drupol\valuewrapper\Type\DoubleType::class, |
||
23 | 'object' => [ |
||
24 | '*' => \drupol\valuewrapper\Object\ObjectValue::class, |
||
25 | 'Anonymous' => \drupol\valuewrapper\Object\AnonymousObject::class, |
||
26 | 'Closure' => \drupol\valuewrapper\Object\ClosureObject::class, |
||
27 | 'DateTime' => \drupol\valuewrapper\Object\DateTimeObject::class, |
||
28 | ], |
||
29 | 'resource' => [ |
||
30 | '*' => \drupol\valuewrapper\Resource\ResourceValue::class, |
||
31 | 'Stream' => \drupol\valuewrapper\Resource\StreamResource::class, |
||
32 | ], |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public static function create($value) : ValueInterface |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 8 | public function make($value) : ValueInterface |
|
75 | } |
||
76 |