phpstorm code completion settings
1. Open the Preferences Editor, Live Templates.
2. Click PHP, add Live Template in the upper right corner, click Define below, and check PHP
3. Add a description and enter the following code in Template Text
$cond = ['conditions' => 'title like :title:', 'bind' => ['title' => '%'.$title.'%']]; $cond['order'] = 'id desc';
When you need to complete the code, just use the Tab key
How to deal with invalid code completion in phpstorm
After installing phpstorm, I found that code highlighting and automatic function prompts were disabled. Some people online said it might be due to the Power save mode. I couldn’t find where this setting was at first.
A system message is found at the information prompt on the bottom panel:
17:04:38 Power save mode is on Code insight and other background tasks are disabled. Do not show again Disable Power Save Mode Click Disable Power Save Mode to turn it off and everything will be normal.
The above is the use of phpstorm automatic code completion in php. I hope it will be helpful to everyone.