dev-master
9999999-devEdition tool for PHP
MIT
The Requires
- php >=5.5
- monolog/monolog ~1.7
- symfony/finder ~2.4
The Development Requires
Edition tool for PHP
A library to edit PHP code., (*2)
Warning! this project is not stable and API might change until the version 1.0.0 is released (no planned date for now)., (*3)
Install this library with composer:, (*4)
composer install alexandresalome/php-editor
<?php use PhpEditor\File; // Open the file $file = File::createFromFile('/path/to/file.php'); // Change the namespace $file->getNamespace()->set('Acme\Model'); // Add a use statement $file->getUses()->add('Acme\Shared\Model\BaseModel'); // Get the class definition $classDefinition = $file->getClass(); // Change the extended class $classDefinition->setExtends('BaseModel'); // Save the file $file->saveToFile('/path/to/file_modified.php');
This library has some limitations for now:, (*5)
<?php
, no ending tag) - #11use Namespace\{Foo, Bar, Baz}
) - #13class X extends Some\Separated\Class
- #14Please refer to those tickets if you want to upvote or contribute on those topics., (*6)
Edition tool for PHP
MIT