mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2025-01-22 21:31:21 +01:00
Merge pull request #150 from eithed/master
Add missing schema declaration
This commit is contained in:
commit
57532207fc
@ -165,7 +165,7 @@ class SchemaAggregator
|
||||
$additional_method_calls = [];
|
||||
|
||||
$nullable = false;
|
||||
|
||||
|
||||
while ($root_var instanceof PhpParser\Node\Expr\MethodCall) {
|
||||
if ($root_var->name instanceof PhpParser\Node\Identifier
|
||||
&& $root_var->name->name === 'nullable'
|
||||
@ -325,7 +325,7 @@ class SchemaAggregator
|
||||
$table->dropColumn($column_name);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
case 'enum':
|
||||
$table->setColumn(new SchemaColumn($column_name, 'enum', $nullable, $second_arg_array));
|
||||
@ -338,6 +338,14 @@ class SchemaAggregator
|
||||
case 'foreign':
|
||||
break;
|
||||
|
||||
case 'foreignid':
|
||||
$table->setColumn(new SchemaColumn($column_name, 'int', $nullable));
|
||||
break;
|
||||
|
||||
case 'foreignuuid':
|
||||
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
|
||||
break;
|
||||
|
||||
case 'geometry':
|
||||
$table->setColumn(new SchemaColumn($column_name, 'mixed', $nullable));
|
||||
break;
|
||||
@ -346,6 +354,10 @@ class SchemaAggregator
|
||||
$table->setColumn(new SchemaColumn($column_name, 'mixed', $nullable));
|
||||
break;
|
||||
|
||||
case 'id':
|
||||
$table->setColumn(new SchemaColumn('id', 'int', $nullable));
|
||||
break;
|
||||
|
||||
case 'increments':
|
||||
$table->setColumn(new SchemaColumn($column_name, 'int', $nullable));
|
||||
break;
|
||||
@ -418,11 +430,21 @@ class SchemaAggregator
|
||||
$table->setColumn(new SchemaColumn($column_name, 'mixed', $nullable));
|
||||
break;
|
||||
|
||||
case 'numericmorphs':
|
||||
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', $nullable));
|
||||
$table->setColumn(new SchemaColumn($column_name . '_id', 'int', $nullable));
|
||||
break;
|
||||
|
||||
case 'nullablemorphs':
|
||||
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', true));
|
||||
$table->setColumn(new SchemaColumn($column_name . '_id', 'int', true));
|
||||
break;
|
||||
|
||||
case 'nullablenumericmorphs':
|
||||
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', true));
|
||||
$table->setColumn(new SchemaColumn($column_name . '_id', 'int', true));
|
||||
break;
|
||||
|
||||
case 'nullableuuidmorphs':
|
||||
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', true));
|
||||
$table->setColumn(new SchemaColumn($column_name . '_id', 'string', true));
|
||||
@ -484,6 +506,10 @@ class SchemaAggregator
|
||||
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
|
||||
break;
|
||||
|
||||
case 'tinytext':
|
||||
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
|
||||
break;
|
||||
|
||||
case 'time':
|
||||
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user