| Conditions | 7 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 7 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 12 | public function makeField(array $field, Column $column): array |
|
| 18 | { |
||
| 19 | 12 | if ($field['field'] === ColumnName::REMEMBER_TOKEN && $column->getLength() === 100 && !$column->getFixed()) { |
|
| 20 | 3 | $field['type'] = ColumnType::REMEMBER_TOKEN; |
|
| 21 | 3 | $field['field'] = null; |
|
| 22 | 3 | $field['args'] = []; |
|
| 23 | |||
| 24 | 3 | return $field; |
|
| 25 | } |
||
| 26 | |||
| 27 | 9 | if ($column->getFixed()) { |
|
| 28 | 3 | $field['type'] = ColumnType::CHAR; |
|
| 29 | } |
||
| 30 | |||
| 31 | 9 | if ($column->getLength() && $column->getLength() !== Builder::$defaultStringLength) { |
|
|
|
|||
| 32 | 6 | $field['args'][] = $column->getLength(); |
|
| 33 | } |
||
| 34 | |||
| 35 | 9 | return $field; |
|
| 36 | } |
||
| 38 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: