Skip to content

Namespace rename #346

Description

@DarkGhostHunter

Description

Allow the namespace of the class to be renamed or moved through renaming, updating class under the namespace and class references

Use case

Want to change \App\Models\Traits to \App\Models\Concerns? Or move all namespace members to \App\Database\Helpers? Good luck:

  • Create the folder
  • Mover everything manually
  • Search and replace
  • ??
  • Profit.

Proposed solution

Allow the namespace to have renaming. Rename the folder where it is if PSR-4 rules apply. Classes under the namespace should have updated references (new namespace), fail if there is a class/trait/interface/file collision.

When moving namespaces (App\Foo\Bar → App\Bar\Quz`), same rules should apply.

Alternatives considered

Shotgun the keyboard.

Code example

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions