官术网_书友最值得收藏!

Using code completion

The best example of the need to use an IDE instead of a standard editor is that an IDE understands your code and thus provides hints about the code that you might be writing or need next.

Getting ready

A standard editor would, at the maximum, provide basic text coloring based on the various keywords. Anyway, without hurting the feelings of editors, PhpStorm provides you with additional options besides providing you the standard code completion system.

How to do it...

There is the smart type completion that not only completes your code, but also finds and suggests the most eligible match for your code. By eligible, it means that the code hint matches the current context (the invoking object). This is particularly useful in cases in which you have honestly stuck to the Software Engineering principle of Inheritance.

Code completion settings in PhpStorm are available at File | Settings | Editor | Code Completion, as shown in the following screenshot:

How to do it...

How it works...

If you have a lot of items for PhpStorm to look up, for example, members of your created class, you can order PhpStorm to provide you with hints in lexicographical order.

To turn this feature on, you need to select the checkbox adjacent to Sort lookup items lexicographically. The following screenshot shows the code completion feature:

How it works...

Code completion at your convenience! I hope this make sense to you.

主站蜘蛛池模板: 闻喜县| 卫辉市| 和田县| 台北县| 尼木县| 凭祥市| 泰和县| 澎湖县| 湘潭县| 贵德县| 潮州市| 梅河口市| 扎赉特旗| 阳春市| 六安市| 怀来县| 永昌县| 武陟县| 乌拉特中旗| 明溪县| 凌云县| 南乐县| 扶绥县| 天等县| 桃江县| 韶山市| 大悟县| 宜都市| 邵阳市| 竹山县| 阜南县| 德惠市| 徐汇区| 沈丘县| 湖州市| 绥中县| 仪征市| 芦溪县| 潜江市| 会昌县| 杭锦后旗|