發表文章

目前顯示的是有「PhpStorm」標籤的文章

推薦2個好用的 PHP Refactoring 重構工具

圖片
1. PhpStorm  PHP 的夢幻逸品 IDE PhpStorm 支援多種重構方法 鼎鼎大名的 PhpStorm IDE 功能超級強大! 對於重構的部分也支援多種方法,官網有 詳細的介紹 : Change Signature Copy/Clone Extract Constant Extract Field Extract Interface Extract Method Extract Parameter Extract Variable Extract Variable for Sass Inline Move Refactorings Pull Members up Push Members down Rename Refactorings Safe Delete 這邊以 Extract function 來示範: Before After <? php if ( ' POST ' != $_SERVER [ ' REQUEST_METHOD ' ]) { header ( ' Allow : POST ' ); header ( ' HTTP / 1.1 405 Method Not Allowed ' ); header ( ' Content - Type : text / plain ' ); exit ; } ?> <? php function printEmptyHeader () { header ( ' Allow : POST ' ); header ( ' HTTP / 1.1 405 Method Not Allowed ' ); header ( ' Content - Type : text / plain ' ); } if ( ' POST ' != $_SERVER [ ' REQUEST_METHOD ' ]) {