Why are Mysql Decimal types mapped as strings?
WordsofDefiance opened this issue · 2 comments
WordsofDefiance commented
https://github.com/barryvdh/laravel-ide-helper/blob/master/src/Console/ModelsCommand.php#L548
This is causing static analysis errors in my app.
barryvdh commented
If you use the decimal cast from Laravel, it will convert to string. Or are you working with floats? Because I think that would lead to more errors.
WordsofDefiance commented
I am using a decimal(8,2)
column in the database, and the first time I ran the ide-helper, it wrote the column as a string
in the docblock. The app expects this column to be a float. I ended up using the custom_db_types
config to override this behavior.
I'm not using casts of any sort.