Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>PHP RefactoringNew to Visual Studio Code? Get it now.
PHP Refactoring

PHP Refactoring

marsl

|
24,022 installs
| (12) | Free
Provides PHP refactoring support.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode PHP Refactoring README

This is the README for the VSCode PHP Refactoring extension.

The plugin is based on the PHP Refactoring Browser by QafooLabs with its latest version by ShahinSorkh.

Features

Extract Method

You can use the Extract Method refactoring in this way: Select the code lines you want to extract to a method. Then use the command 'PHP: Extract Method'. Enter the new method name. The new method will be created outside the scope of your current method and will be called at your current location.

Rename Local Variable

You can use Rename Local Variable refactoring in this way: Select the variable with or without the dollar sign you want to rename. Then use the command 'PHP: Rename Local Variable'. Enter the new variable name with or without the dollar sign. Every occurence of the variable in the specific block will be renamed.

Rename Class Property

You can use Rename Class Property refactoring in ths way: Select the class property with or without the dollar sign you want to rename. Then use the command 'PHP: Rename Class Property'. Enter the new class property name with or without the dollar sign. Every occurence of the class property in the specific class will be renamed. WARNING: Right now only private class properties can be properly renamed. If the class property is public and used in other files and classes this refactoring will not work.

Requirements

Please note. PHP need to be installed on your machine and it should be set in the environment path or in the Visual Studio Code settings.

Release Notes

1.3.0

Added support for PHP 7 and PHP 8.

1.2.0

Added support for Rename Class Property refactoring.

1.1.0

Added support for Rename Local Variable refactoring.

1.0.0

Initial release of the VSCode PHP Refactoring extension with support for Extract Method refactoring.

Support me

If you like this extension for VS Code and want to invite me for a virtual beer or slice of cake, you can make a donation:

Paypal

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft