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

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.

主站蜘蛛池模板: 博爱县| 确山县| 射阳县| 赤城县| 洪雅县| 梧州市| 班玛县| 进贤县| 金山区| 宜昌市| 阿克| 武汉市| 秭归县| 江西省| 武川县| 嵊州市| 咸宁市| 山西省| 久治县| 黄浦区| 桃源县| 陕西省| 济南市| 乌海市| 福清市| 闻喜县| 自贡市| 鄂温| 东丽区| 宜城市| 永善县| 基隆市| 邵武市| 合川市| 郑州市| 怀集县| 金华市| 河东区| 常熟市| 大名县| 夏河县|