1 | <?php |
||
8 | class TypeValueConverter implements ValueConverterInterface |
||
9 | { |
||
10 | private static $availableTypes = array( |
||
11 | 'boolean', |
||
12 | 'bool', |
||
13 | 'integer', |
||
14 | 'int', |
||
15 | 'float', |
||
16 | 'double', |
||
17 | 'string', |
||
18 | 'array', |
||
19 | 'object', |
||
20 | 'null' |
||
21 | ); |
||
22 | |||
23 | private $type; |
||
24 | |||
25 | public function __construct($type) |
||
33 | |||
34 | public function convert($value) |
||
41 | |||
42 | public static function boolean() |
||
46 | |||
47 | public static function integer() |
||
51 | |||
52 | public static function float() |
||
56 | |||
57 | public static function string() |
||
61 | |||
62 | public static function arr() |
||
66 | |||
67 | public static function object() |
||
71 | |||
72 | public static function null() |
||
76 | } |
||
77 |