I have a little annoying problem on my PhpStorm IDE (Version 2017.3.4).
So I am trying to have suggestion of my constants defined on my project. But when I am trying to Ctrl + Space there is none of my define constants.
All my constant are define like this in my project :
In a file :
$configFileDir = "configfile.php";
if (file_exists($configFileDir)) {
require_once($configFileDir);
try {
define('CONSTANT1', $MY_CONSTANT["CONSTANT1"]);
define('CONSTANT2', $MY_CONSTANT["CONSTANT2"]);
...
}
}
All my constants are in an array called $MY_CONSTANT
loaded in the file configfile.php
.
Another thing : in my project these constants are define 2 times.
If somebody have an idea this would be cool :) .
To get the suggestions from the IDE, I just removed the try..catch
block arround the defines instructions. After that we can get the autocompletion for these constants :) . ( Big thanks to @LazyOne )
I have found a solution :
To get the suggestions from the IDE, I just removed the try..catch
block arround the defines instructions.
After that we can get the autocompletion for these constants.
( Big thanks to @LazyOne )