DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
79 stars 10 forks source link

Invalid "call to unknown function/method" problems flagged #562

Closed tanzanite777 closed 4 months ago

tanzanite777 commented 4 months ago

Type: Bug

Encountered a rare issue - function_exists/method_exists is not seen as guarding against missing function usage:

class Hmm {}
// Bug: incorrectly flagged as problems - "Call to unknown function/method"
if(function_exists('optionalFunction')) optionalFunction();
if(method_exists('Hmm', 'optionalMethod')) Hmm::optionalMethod();

Extension version: 1.46.15409 VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:13:33.891Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (8 x 3600)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.88GB (5.69GB free)| |Process Argv|--crash-reporter-id adf79977-8c83-4303-918e-a7dfc5f31bf1| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 tftest:31042121 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 showvideot:31016892 chatpanelc:31048052 dsvsc021:30996838 bdiig495:31013172 pythoncenvpt:31049070 fchga941:31046352 pythonprt:31047983 dwnewjupyter:31046869 fa862199:31048878 ```
jakubmisek commented 4 months ago

thank you for reporting the issue!

You are right, we are too strict here, ignoring the checks above. Will be implemented.

jakubmisek commented 4 months ago

implemented - will be in the next update.