Skip to content

koriym/spaceman

Repository files navigation

Spaceman

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

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

About

Give namespace to un-namespaced legacy php code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages