PhpED: PHP IDE
new features
features
version comparison
features: php tools
php debugger
php profiler
php frameworks
php scripts
features tour
licensing
php testing
PhpED difference
PhpED on Mac/Linux
testimonials
PhpDock
Nu-Coder
PhpExpress
TechPlatform

Refactoring in PhpED

Refactoring functionality allows you to easily rename your variables, functions, classes and methods and also extract the blocks of code lines into functions or methods.

How to Rename an Identifier in PHP IDE?

To rename all or selected occurrences of a variable, function, class or a method you need to first select it in the editor. You can select either definition of the variable, function, class or method itself or any occurrences or calls to it in the files. With an identifier is selected for renaming, click on Rename button in Refractor menu. If the file where you made you selection is not in active Project, PhpED will prompt you to make that file's Project active automatically and Rename browser will come up. As PhpED is searching for all occurrences of the selected identifier in the Active Project files, the progress will be shown on the Rename browser progress bar. Refactor in PHP IDE: rename

Content of Rename browser

Rename browser consists of the following fields:
  • Type: The type of the selected identifier, as determined by PhpED - could be Class, Variable, Function or Method (read only)
  • Identifier: identifier selected for renaming (read only)
  • New Name: new name for the identifier
  • Apply and Cancel buttons: Apply renaming or cancel it correspondingly
  • Found occurrences: Display of the tree of files and the occurrences of the selected identifier in them with check boxes next to them. Uncheck the boxes next to the occurrences that you don't want to be renamed. By the system will check on all found occurrences of the identifier
  • Before After diff view: side by side display of differences in the code before and after renaming would have taken effect.
Button Apply becomes available only when you type in New Name different from existing Identifier. Once Apply is selected PhpED will replace all selected occurrences of the Identifier with New Name and close Rename Browser. All files containing selected occurrences of the Identifier will be open and marked as modified. You can save them to persist the changes in the name

How to Extract method or function in PHP IDE?

To extract a block of code into a function or method in PhpED, select the code in the Editor and click on Extract method or function button of Refactor menu. Extract method or function browser will come up. Refactor in PHP IDE: extract

Content of Extract method or function browser

Extract method or function browser consists of the following fields:
  • Method (Function) name: the name for new extracted method or function. If the selected code is part of PHP class the extraction will be made into a new method, otherwise it will be made into a function
  • Access Level: select desired access level for newly extracted method or function
  • Parameters: list of all variables found in the selected code.These variables will be passed to new method or function. You can control the calling sequences of these parameters by moving the variables on the list up or down.
  • Found occurrences: ???. By the system will check on all found occurrences of the identifier
  • Before After diff view: side by side display of differences in the code before and after extraction would have taken effect.
Once Apply is selected PhpED will create new function/method and replace selected code with the call to the function/method and close Extract method or function Browser. All files containing selected occurrences will be open and marked as modified. You can save them to persist the changes.

Refactoring goes hand in hand with testing and debugging. PhpED provides the tools for both - You can watch a live demonstration of phpUnit and PHP debugger as well as advanced remote PHP debugging from our video tutorial library. Additional technical information is available on the NuSphere Forum. Download a free trial of our PHP IDE today!

 Download NuSphere PHP IDE

Download a free trial of the fast PHP EDitor and robust Integrated Development Environment for PHP.

 Buy NuSphere PhpED® now

Best PHP Editor and complete PHP IDE.
NuSphere PhpED 20.0 is available from our online store front.
"To be honest its bloody awesome, I have looked at loads of PHP editors and this is THE only one that actual works straight out of the box!!! Brilliant, well done."
Andrew Breward,
Director of Technology
caboodal.com

 Guide

Walk through NuSphere PhpED interface
PhpED video tutorial: Webservices
Learn how to add webservices to your code in less than 5 minutes (a flash demo).

 Special Team4 Offer

Get 4 copies of PhpED for the price of 3!

Optimum solution for development teams.
PhpED 20.0 Team4
Need more than 4 licenses? Contact Us for more quantity discounts, please use "Ordering/Payment issue" subject on the form.

 Dr. Dobb's

Dr. Dobb's

Dr. Dobb's Magazine covers NuSphere PhpED in New and Noteworthy section.

 InfoWorld

infoworld.com
PhpED is a proper, world-class IDE for PHP code. It is the only IDE worth considering if PHP development is your primary job