Closed vasekbrychta closed 5 years ago
Hi, to fix this I would need an actual reproduction. This seems like not properly initialized relationship container. This behaviour is currently covered by tests, so there will be some mistake.
I'm missed the most important thing this is reported on phpstan extension repo... 🤕 . Ok, sorry.
This is known limitation and I'm working on a fix. The fix require some changes in PhpStan, which I hope are quite near mering
In my projects I currently ignore this errors by
- '#Property [\w\\]+::\$\w+ \([\w|\\]+\) does not accept int\.#'
- '#Property [\w\\]+::\$\w+ \([\w|\\]+\) does not accept int|null\.#'
Be aware they are not super-save.
Ok, that's great! Thanks for the workaround. I might add the common namespace prefix for all my Entities to be more safe for now.
Finally fixed, right now works only with PhpStan master.
Having similar definition
and calling
$book->author = 1;
generatesalthough the Author entity is correctly auto-loaded.