-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TINYINT database column identified as bool by Automatic phpDocs for models #480
Comments
Makes sense, can you make a Pr? |
Could be related: doctrine/dbal#1205 It may be best to classify dbal's |
jclee100
added a commit
to jclee100/laravel-ide-helper
that referenced
this issue
Apr 4, 2017
`tinyint` is classified by bool as doctrine/dbal, but it should not be so in our use case. `tinyint` is better PHPDoc'ed as int. If the user wants bool, he should use Eloquent's `$casts` property to do that.
Belphemur
pushed a commit
to Belphemur/laravel-ide-helper
that referenced
this issue
Apr 10, 2017
This reverts commit d11bf58.
cgxxv
pushed a commit
to cgxxv/laravel-ide-helper
that referenced
this issue
Mar 25, 2022
* Fix barryvdh#480 where tinyint is casts as bool `tinyint` is classified by bool as doctrine/dbal, but it should not be so in our use case. `tinyint` is better PHPDoc'ed as int. If the user wants bool, he should use Eloquent's `$casts` property to do that. * Pass PSR-2 check * Remove comment as requested
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
php artisan ide-helper:models
, aTINYINT
column is documented asbool
.While
TINYINT
is commonly used to representbool
, I am using it to map to a small amount of model states.And while I do not know what's the best way to differentiate the two, the length of the column can be used to at least rule out
bool
if it's>1
. i.e.TINYINT(2)
can never bebool
.The text was updated successfully, but these errors were encountered: