Conditions | 8 |
Paths | 10 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function makeField(string $tableName, array $field, Column $column): array |
||
26 | { |
||
27 | if ($field['field'] === ColumnName::REMEMBER_TOKEN && $column->getLength() === 100 && !$column->getFixed()) { |
||
28 | $field['type'] = ColumnType::REMEMBER_TOKEN; |
||
29 | $field['field'] = null; |
||
30 | $field['args'] = []; |
||
31 | } else { |
||
32 | if ($column->getFixed()) { |
||
33 | $field['type'] = ColumnType::CHAR; |
||
34 | } |
||
35 | |||
36 | if ($column->getLength() && $column->getLength() !== Builder::$defaultStringLength) { |
||
|
|||
37 | $field['args'][] = $column->getLength(); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | $collation = $this->collationModifier->generate($tableName, $column); |
||
42 | if ($collation !== '') { |
||
43 | $field['decorators'][] = $collation; |
||
44 | } |
||
45 | |||
46 | return $field; |
||
47 | } |
||
49 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: