koriym/spaceman

1.0.3 2020-07-04 22:23 UTC

This package is auto-updated.

Last update: 2024-03-31 02:02:09 UTC


README

Dealing with old unnamaspaced code does not seem fun. Something you had to do at work?

64026400-a6b6f400-cb79-11e9-9fd0-f14dcf424e67.png

Installation

composer require koriym/spaceman --dev

Usage

<?php

use Koriym\Spaceman\Convert;

require dirname(__DIR__) . '/vendors/autoload.php';

$sourcePath = __DIR__ . '/service/protected/controllers';

// Rewrite php file with adding namespace declaration starting `$packageName` on directory basis
$packageName = 'application';
(new Convert($packageName))($sourcePath);