2017 © Pedro Peláez
 

library namae-space

image

gong023/namae-space

  • Thursday, March 23, 2017
  • by gong023
  • Repository
  • 1 Watchers
  • 4 Stars
  • 383 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

NamaeSpace

Build Status, (*1)

NamaeSpace is util command for PHP namespace. this command enables you to find and replace namespace using static analysis., (*2)

gif, (*3)

Installation

composer require --dev gong023/namae-space

Usage

Find

namaespace find -C $HOME/your/project \ # path to your project composer.json
                -F Name\\YourClass      # Name what you want to find

namaespace command stdouts usage of Name\\YourClass., (*4)

See --help to know further., (*5)

Replace

namaespace replace -C $HOME/your/project      \ # path to your project composer.json
                   -O Origin\\YourOriginClass \ # Replaced OriginName
                   -N New\\YourNewClass         # NewClassName which you want to replace

namaespace command finds YourOriginClass, and then replaces it to YourNewClass., (*6)

You can pass -D or --dry_run option if you wanna test before replace. See --help to know further., (*7)

Unlike IDE, NamaeSpace can change Global namespace to be named., (*8)

How does it work

namaespace finds paths by reading composer.json and analyses codes., (*9)

Mainly analysis is delegated to nikic/PHP-Parser. You don't have to worry about instability of regex., (*10)

And analysis is executed under multi processing. You can pass -M or --max_process option to control number of process for any commands., (*11)

The Versions