allow a user to define the type overrides

This commit is contained in:
Andrew Ellis
2016-08-19 12:20:34 -06:00
parent 0a4ff969d2
commit f8c6ec95f6
2 changed files with 30 additions and 4 deletions
+14 -1
View File
@@ -279,11 +279,24 @@ class ModelsCommand extends Command
if (!isset($this->properties[$name])) {
continue;
} else {
$this->properties[$name]['type'] = $realType;
$this->properties[$name]['type'] = $this->getTypeOverride($realType);
}
}
}
/**
* Returns the overide type for the give type.
*
* @param string $type
* @return string
*/
protected function getTypeOverride($type)
{
$typeOverrides = $this->laravel['config']->get('ide-helper.type_overrides', array());
return isset($typeOverrides[$type]) ? $typeOverrides[$type] : $type;
}
/**
* Load the properties from the database table.
*