You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This indicates an error in my code, but the crash is unexpected. I'm providing the bug report and stack trace as the PHPStan output requests, but through some quick trial-and-error I was able to determine that #[Mapping\Column] on a class property that's unsupported would trigger it.
Not sure if this would happen if Doctrine had a custom type mapper set which allows this to work (seeing the stack trace, it looks like probably), but I think PHPStan, or more specifically the Doctrine extension, should catch the assertion error and translate it into an analysis warning of some kind.
Simple reproduce code:
<?phpdeclare(strict_types=1);
namespaceApp\Entities;
useDoctrine\ORM\Mapping;
#[Mapping\Entity]
class Bug
{
#[Mapping\Column]
#[Mapping\Id]
publicstring$id;
#[Mapping\Column]
publicStatus$status;
publicfunctioncauseError(): void
{
$this->a = 1; // This should error, instead PHPStan crashes
}
}
enum Status
{
case Working;
case Broken;
}
Bug report
This indicates an error in my code, but the crash is unexpected. I'm providing the bug report and stack trace as the PHPStan output requests, but through some quick trial-and-error I was able to determine that
#[Mapping\Column]
on a class property that's unsupported would trigger it.Not sure if this would happen if Doctrine had a custom type mapper set which allows this to work (seeing the stack trace, it looks like probably), but I think PHPStan, or more specifically the Doctrine extension, should catch the assertion error and translate it into an analysis warning of some kind.
Simple reproduce code:
Code snippet that reproduces the problem
No response
Expected output
No crash, possibly an indication of an invalid column mapping.
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: