`unsignedTinyInteger` column has `bool` PHPDoc in generated `_ide_helper_models.php` file

1
open
canvural
canvural
Posted 2 months ago

`unsignedTinyInteger` column has `bool` PHPDoc in generated `_ide_helper_models.php` file #1245

Versions:

  • ide-helper Version: 2.10.0
  • PHP Version: 8.0.8

Description:

I have a column in my migration which uses unsignedTinyInteger And in database it's type is TINYINT(3) with unsigned flag on.

When I run php artisan ide-helper:models -N ide-helper generates the file and this column has * @property bool $quantity above the class.

I expected it to just have int

Steps To Reproduce:

  1. Have a migration with $table->unsignedTinyInteger('quantity'); in it
  2. Run php artisan ide-helper:models -N
mfn
mfn
Created 2 months ago

I couldn't quickly locate any code in this library having a special case for the tiny* variants.

Maybe this is a doctrine/dbal behaviour? I found e.g. https://github.com/doctrine/dbal/blob/e974d4deca8c430d9eba0975f441538145a5a8f1/src/Platforms/MySQLPlatform.php#L1083

There's also https://github.com/doctrine/dbal/blob/e974d4deca8c430d9eba0975f441538145a5a8f1/src/Platforms/MySQLPlatform.php#L299-L302 but I think this is for the reverse.

So maybe the issue is that the tinyint check there does not honor the "precision"?

Note: I don't know dbal well, this is a lot of guessing and I may have miss-analyzed things here.