Regarding mysql's functions in PhpStorm

Does anyone know why PhpStorm is marking MySQL's functions (e.g. mysqli_connect, mysqli_fetch_assoc) as functions that do not return a value even though those functions clearly do?  The exact message is "The value of a void function is used by mistake, because such functions do not have a return value".

Thanks.

0
Avatar
Permanently deleted user

Thanks, Andriy.  Do you know if there's anything we can do to fix this issue ourselves?

0

Well -- you can open that file (.jar is ordinary .zip archive), find the file and add proper @return tag to those problematic functions.

Instead of editing that php.jar you could create your own stub file (place in anywhere in your project) with correct PHPDoc blocks, so PhpStorm will read them from your location. I'm just unsure if it will work smooth (I mean -- no conflicts with original declarations) since there will be 2 declarations to choose from.

0
Avatar
Permanently deleted user

Thanks, Andriy.  Will poke around and see what can be done.  These are my first couple of days with IntelliJ.  I have to say I'm very impressed with it so far.  Thanks for helping me in learning it.  Appreciate it!

0
Avatar
Permanently deleted user

I unjar the php.jar and edited the mysqli.php, giving it return values such as "@return array".  Then I rejar the files into a new php.jar and copy it over the original one.  I restarted Intellij but it's still gave the same "'void' function" warning.  I also did a "Invalidate Caches" on Intellij, but still nothing.

Did I miss out anything?

Thanks in advance.

0

BTH -- don't know. I may only suggest double checking that you have edited the correct file/class.

If still nothing -- just submit a ticket to the Issue Tracker.

0

..Attaching a version with your edits will help.

0

请先登录再写评论。