phptools-docs icon indicating copy to clipboard operation
phptools-docs copied to clipboard

Wrong variable type after being reasigned

Open str opened this issue 1 year ago • 0 comments

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

  1. setting the $field as AbstractField image

  2. confirming $field is an AbstractField image

  3. overwriting $field with $field->html() which returns a string, so $field should be a string now image

  4. but vscode still thinks $field is an AbstratField, not a string image

str avatar Sep 18 '24 17:09 str