phptools-docs
phptools-docs copied to clipboard
Wrong variable type after being reasigned
I'm hinting the class to a $variable, because I'm setting the class on runtime. After that, the $variable changes it's type, hinted by a method, but the new type is not reflected, and the old type is still used, which is wrong
-
setting the $field as AbstractField
-
confirming $field is an AbstractField
-
overwriting $field with $field->html() which returns a string, so $field should be a string now
-
but vscode still thinks $field is an AbstratField, not a string