The IDE (PS-117.65) is complaining that some of constants aren't defined.
I've defined them in a loop in another file. Can I put a doc comment at the top of this file to inform it about the constants? The usual /** @var
and @global
syntax doesn't seem to work for constants.
There is no known to me PHPDoc comment to do that.
But you can "fake" them -- create some const.php
file and place it anywhere in a project (you can even place it in separate folder outside the project and attach it as External Library or as separate Content Root).
In this file -- define those constants with in a normal way: define("CONST_NAME", "value");
The "value" part can be anything (as long as types are matching -- useful for inspections/code analysis) -- it really depends where those constant will be used (e.g. if they are used in include/require statements, then it may be beneficial to have some real (or close to it) values there).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With