class a{ static $config = [ 'id' => 1, 'status' => ['status1'=>1,'status2'=>2] ]; }
$s = new A ();
Echo s::config->id;
Die
How to make S:: $config can automatically fill out the ID and status .....
Reply content:
class a{ static $config = [ 'id' => 1, 'status' => ['status1'=>1,'status2'=>2] ]; }
$s = new A ();
Echo s::config->id;
Die
How to make S:: $config can automatically fill out the ID and status .....
Of course, you can do this by using the Phpdoc annotation, an auxiliary class that implements the Arrayaccess interface with the prompt attributes you need.
The principle is actually to let the IDE mistakenly think that this array is a class and then automatically prompt the completion of the property name, and Arrayaccess has the class object as an array operation of the "Black" magic.
The IDE's code hints are generated at the time of loading the project index, and then enter the relevant characters when the search completion prompt, array this if also to hint, the probability is very small, this consumes too much resources, and are local, non-stop retrieval. But if you use sublime it will prompt the most recent words, this may be enough to meet your needs
Phpstorm can automatically prompt the class member variable, as to the element that prompts the array type member variable, temporarily did not involve
The Generic IDE development tool will prompt you for class member variables and class member method names, but you're suggesting that I haven't found them yet.
Basically, these arrays are created at run time, and parsing is not done at this point, and it is not necessary.
Like what:
I'm going to delete a key from the array in the code, what do I suggest?
The complement annotation and complement on the structure level of this array is not as good as the research phpdoc.
Arrayaccess
The new version of the Phpstorm has been supported, today colleagues said he has a hint Ah, my const array declaration directly on the red .... His phpstorm support ...!!
PHPDoc +1 can refer to this http://www.07net01.com/progra ...
Some Ides can be implemented by the installation of the corresponding plugin can also be recommended with sublime