ajiho/namespaceify

Used to solve global function conflicts

v1.0.1 2024-05-13 19:51 UTC

This package is auto-updated.

Last update: 2024-11-13 21:06:47 UTC


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();