Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename namespace in NetBeans PHP?

Tags:

php

netbeans

is there a way to easily rename a namespace in NetBeans ide that affects all other namespace declarations?

like image 646
Rain Avatar asked Apr 17 '12 01:04

Rain


1 Answers

This is a workaround but can help you to change all namespaces declarations inside the project:

  1. Click on the folder that contains all your sources files (e.g. src/ in the root of the project)
  2. Press CTRL+H
  3. Type the namespace or part of the namespace you want to replace (e.g. Foo\Bar) in the search field and target namespace to the 'replace with' field (e.g. Foo\MyNewBar)
  4. Click replace
  5. After a while, to the bottom of the screen you will have all places that can be replaced. You can replace all or select only some of them. Be carefull though, all files are saved automatically after the change.
like image 70
Michael Szymczak Avatar answered Oct 29 '22 13:10

Michael Szymczak