@@ -28,8 +28,30 @@ public static function parse(): array
2828 ['int DEFAULT (1 + 2) ' , ['type ' => 'int ' , 'defaultValueRaw ' => '(1 + 2) ' ]],
2929 ["int COMMENT '''Quoted'' comment' " , ['type ' => 'int ' , 'comment ' => "'Quoted' comment " ]],
3030 ['int CHECK (value > (1 + 5)) ' , ['type ' => 'int ' , 'check ' => 'value > (1 + 5) ' ]],
31- ["enum('a','b','c') " , ['type ' => 'enum ' , 'enumValues ' => ['a ' , 'b ' , 'c ' ]]],
32- ["enum('a','b','c') NOT NULL " , ['type ' => 'enum ' , 'enumValues ' => ['a ' , 'b ' , 'c ' ], 'notNull ' => true ]],
31+ [
32+ "enum('a','b','c') " ,
33+ ['type ' => 'enum ' , 'enumValues ' => ['a ' , 'b ' , 'c ' ]],
34+ ],
35+ [
36+ "enum('a','b','c') NOT NULL " ,
37+ ['type ' => 'enum ' , 'enumValues ' => ['a ' , 'b ' , 'c ' ], 'notNull ' => true ],
38+ ],
39+ 'enum-with-square-brackets ' => [
40+ "enum('[one]', 'the [two]', 'the [three] to') NOT NULL " ,
41+ ['type ' => 'enum ' , 'enumValues ' => ['[one] ' , 'the [two] ' , 'the [three] to ' ], 'notNull ' => true ],
42+ ],
43+ 'enum-with-parentheses ' => [
44+ "enum('(one)', 'the (two)', 'the (three) to') NOT NULL " ,
45+ ['type ' => 'enum ' , 'enumValues ' => ['(one) ' , 'the (two) ' , 'the (three) to ' ], 'notNull ' => true ],
46+ ],
47+ 'enum-with-escaped-quotes ' => [
48+ "enum('hello''world''', 'the ''[feature]''') NOT NULL " ,
49+ ['type ' => 'enum ' , 'enumValues ' => ["hello'world' " , "the '[feature]' " ], 'notNull ' => true ],
50+ ],
51+ 'enum-with-parentheses-and-escaped-quotes ' => [
52+ "enum('''hey (one)', 'the (t''wo)', 'the (three) ''to') NOT NULL " ,
53+ ['type ' => 'enum ' , 'enumValues ' => ['\'hey (one) ' , 'the (t \'wo) ' , 'the (three) \'to ' ], 'notNull ' => true ],
54+ ],
3355 ['int[] ' , ['type ' => 'int ' , 'dimension ' => 1 ]],
3456 ['string(126)[][] ' , ['type ' => 'string ' , 'size ' => 126 , 'dimension ' => 2 ]],
3557 ];
0 commit comments