2017 © Pedro Peláez
 

library php-editor

Edition tool for PHP

image

alexandresalome/php-editor

Edition tool for PHP

  • Monday, January 27, 2014
  • by alexandresalome
  • Repository
  • 1 Watchers
  • 3 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP Editor

Automated tests status, (*1)

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)

Installation

Install this library with composer:, (*4)

composer install alexandresalome/php-editor

Usage

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

Documentation

Limitations

This library has some limitations for now:, (*5)

  • Only monolithic PHP files (starts with <?php, no ending tag) - #11
  • Only PHP files with zero or one namespace defined - #12
  • Does not support multi-use syntax (use Namespace\{Foo, Bar, Baz}) - #13
  • Does not support class X extends Some\Separated\Class - #14

Please refer to those tickets if you want to upvote or contribute on those topics., (*6)

The Versions

27/01 2014

dev-master

9999999-dev

Edition tool for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires