Closed feropeterko closed 1 month ago
Exactly. I have a class that inherits ActiveRow and I'm now unable to use __set and __unset methods because of "never". Maybe "never" should be used only for "final" classes/methods that cannot be inherited from.
Hi, any update on this? Has anyone who is struggling with this issue managed to overcome it somehow? Thanks.
Hi, I'm little disappointed from the support of this wide-used library. Unfortunatelly whole Nette forces data types in last years which is mostly correct but must not be forced like this. There are many users customizing functions for their needs.
Mostly you can use some reflection hacks (magic methods, ...) but not this time. Current change does not have a solution. I've been forced to drop the inheritance and make a wrapper. Perhaps you can find an inspiration in my solution https://github.com/varhall/dbino/blob/master/src/Model.php .
Thank you @dg for changing type from never to void! But please consider changing it also for __unset method for consistency.
Version: 3.2.0
Bug Description
New return type "
never
" of magic__set
is too strict. It forces to throw an exception and disables the possibility to inherit\Nette\Database\Table\ActiveRow
.Steps To Reproduce
Inherit class
\Nette\Database\Table\ActiveRow
and override__set
method.Expected Behavior
Return standard type "
void
" and throw same exception. Do not force the exception with "never
" return type.