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

No error for referencing non-existent class's static variable

Open php4fan opened this issue 1 year ago • 3 comments

In this code: image the class \vBP_Engine does not exist. I meant to write \vBP_Engine but I forgot the back slash.

However, the IDE didn't catch it and showed to error or warning.

Some more tests: image

It seems to happen systematically when referencing static variables in a class.

php4fan avatar Jul 25 '24 18:07 php4fan

That's weird, we should underline any unknown class name,

We only don't underline when indexing is in progress, or when the class was already underlined in the function previously.

jakubmisek avatar Jul 25 '24 21:07 jakubmisek

We also don't underline unknown classes when indexing has not yet finished.

jakubmisek avatar Jul 28 '24 16:07 jakubmisek

Does this not reproduce for you?

<?php

echo NonExistentClass::$foo;

php4fan avatar Aug 06 '24 12:08 php4fan

@php4fan I see, it does! thank you

jakubmisek avatar Aug 07 '24 15:08 jakubmisek

Fixed

jakubmisek avatar Aug 07 '24 15:08 jakubmisek