Conditions | 5 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | public function normalizeDefaultValue(string|null $value): int|ExpressionInterface|null |
||
45 | { |
||
46 | if ($value === null || $this->isComputed() || preg_match("/^\(?NULL\b/i", $value) === 1) { |
||
47 | return null; |
||
48 | } |
||
49 | |||
50 | if (preg_match("/^[Bb]?'([01]+)'/", $value, $matches) === 1) { |
||
51 | /** @var int */ |
||
52 | return bindec($matches[1]); |
||
53 | } |
||
54 | |||
55 | return new Expression($value); |
||
56 | } |
||
58 |