-
Notifications
You must be signed in to change notification settings - Fork 103
Add missing descriptors for SmallFloatType
and EnumType
#656
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
base: 2.0.x
Are you sure you want to change the base?
Conversation
janedbal
commented
Apr 24, 2025
- Implement an EnumType for MySQL/MariaDB doctrine/dbal#6536 (since dbal 4.2)
- Add SmallFloat type doctrine/dbal#6471 (since dbal 4.1)
2082cc3
to
2e8b2b6
Compare
path: src/Type/Doctrine/Descriptors/SmallFloatType.php | ||
|
||
- | ||
message: '#^Class Doctrine\\DBAL\\Types\\EnumType not found\.$#' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first, I tried adding new doctrine versions to composer.json, but it would require bigger effort to adjust this repo to support those everywhere, so I just referenced those not-yet-existing classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- tests describing what this actually fixes would be nice
|
||
namespace PHPStan\Type\Doctrine\Descriptors; | ||
|
||
class SmallFloatType extends FloatType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No inheritance please
use PHPStan\Type\StringType; | ||
use PHPStan\Type\Type; | ||
|
||
class EnumType implements DoctrineTypeDescriptor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I wrong or without this type the data is considered as mixed ?
Now with this, it will report error foo be 'A'|'B' but is string
on level 8 because the values option is not considered in the following code
#[ORM\Column(name: 'foo', type: Types::ENUM, options: ['values' => ['A', 'B'])]