1 | <?php |
||
19 | class TypesManager extends AbstractPluginManager |
||
20 | { |
||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $factories = [ |
||
25 | InArrayType::class => InvokableFactory::class, |
||
26 | RegexType::class => InvokableFactory::class, |
||
27 | IntegerType::class => InvokableFactory::class, |
||
28 | FloatType::class => InvokableFactory::class, |
||
29 | StringType::class => InvokableFactory::class, |
||
30 | |||
31 | // v2 canonical FQCNs |
||
32 | |||
33 | 'svyckasettingstypeinarraytype' => InvokableFactory::class, |
||
34 | 'svyckasettingstyperegextype' => InvokableFactory::class, |
||
35 | 'svyckasettingstypeintegertype' => InvokableFactory::class, |
||
36 | 'svyckasettingstypefloattype' => InvokableFactory::class, |
||
37 | 'svyckasettingstypestringtype' => InvokableFactory::class, |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $aliases = [ |
||
44 | 'inarray' => InArrayType::class, |
||
45 | 'regex' => RegexType::class, |
||
46 | 'integer' => IntegerType::class, |
||
47 | 'float' => FloatType::class, |
||
48 | 'string' => StringType::class, |
||
49 | |||
50 | /** |
||
51 | * @deprecated only for BC reasons, will be removed when possible |
||
52 | */ |
||
53 | 'in_array' => 'inarray', |
||
54 | ]; |
||
55 | |||
56 | /** |
||
57 | * Whether or not to share by default; default to false |
||
58 | * |
||
59 | * @var bool |
||
60 | */ |
||
61 | protected $shareByDefault = false; |
||
62 | |||
63 | /** |
||
64 | * Validate the plugin |
||
65 | * |
||
66 | * Checks that the type loaded is instance of SettingTypeInterface. |
||
67 | * |
||
68 | * @param SettingTypeInterface $type |
||
69 | * |
||
70 | * @return void |
||
71 | * @throws \RuntimeException if invalid |
||
72 | */ |
||
73 | 13 | public function validate($type) |
|
84 | |||
85 | /** |
||
86 | * Validate the plugin |
||
87 | * |
||
88 | * Checks that the type loaded is instance of SettingTypeInterface. |
||
89 | * |
||
90 | * @param SettingTypeInterface $type |
||
91 | * |
||
92 | * @return void |
||
93 | * @throws \RuntimeException if invalid |
||
94 | */ |
||
95 | 13 | public function validatePlugin($type) |
|
99 | } |
||
100 |