ajiho / namespaceify
Used to solve global function conflicts
v1.0.1
2024-05-13 19:51 UTC
Requires
- php: >=7.0
- nikic/php-parser: ^4.17
Requires (Dev)
- cakephp/core: ~4.3.0
- illuminate/database: ^7.0
README
Add a namespace to the file and replace the function call in the specified directory with a function call in the specified namespace
Installation
composer require ajiho/namespaceify
Usage
Use special use cases to demonstrate usage
$filename = dirname(__DIR__) . '/vendor/cakephp/core/functions.php'; $pkgDir = dirname(__DIR__) . '/vendor/cakephp'; $parser = new \ajiho\namespaceify\Parser($pkgDir, $filename, 'Cake\Core'); $parser->run();
$filename = dirname(__DIR__) . '/vendor/illuminate/support/helpers.php'; $pkgDir = dirname(__DIR__) . '/vendor/illuminate'; $parser = new \ajiho\namespaceify\Parser($pkgDir, $filename, 'Illuminate\Support'); $parser->run();