PHP Classes
elePHPant
Icontem

PHP Code Generator: Generate PHP code elements programatically

Recommend this page to a friend!
  Info   View files Documentation   View files View files (50)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-05-23 (1 month ago) RSS 2.0 feedStarStarStarStar 70%Total: 310 This week: 2All time: 6,989 This week: 345Up
Version License PHP version Categories
php-generator 1.0.7MIT/X Consortium ...5.3.3PHP 5, Libraries, Code Generation
Description Author

This package can generate PHP code elements programatically.

It provides a set of classes that can generate PHP code elements of different types like PHP files, classes, interfaces, functions, function patrameters, variables and annotations.

Another set of classes can generate more complex components made of base PHP code elements that are passed to these classes as object parameters.

Innovation Award
PHP Programming Innovation award nominee
September 2015
Number 8


Prize: One copy of the Zend Studio
One common way to generate code in PHP or any other language is to use templates and replace variable values.

This package provide an alternative approach that consists in classes of objects that represent each type of construct of the PHP language, like classes, interfaces, functions, variables, etc..

It can define the PHP code you want to generate by combining language element objects in a hierarchic way.

Manuel Lemos
  Performance   Level  
Name: WsdlToPhp <contact>
Classes: 8 packages by
Country: France France
Age: 33
All time rank: 95333 in France France
Week rank: 31 Up2 in France France Up
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

Details

WsdlToPhp Php Generator, a Real PHP source code generator

License Latest Stable Version Build Status PHP 7 ready Scrutinizer Code Quality Code Coverage Dependency Status StyleCI SensioLabsInsight

Even if this project is yet another PHP source code generator, its main goal is to provide a consistent PHP source code generator for the PackageGenerator project. Nevertheless, it also aims to be used for any PHP source code generation process as it generates standard PHP code.

Rest assured that it is not tweaked for the purpose of the PackageGenerator project.

Main features

This projet contains two main features:

  • Element: generate basic elements
  • Component: generate structured complex elements

Unit tests

You can run the unit tests with the following command:

    $ cd /path/to/src/WsdlToPhp/PhpGenerator/
    $ composer install
    $ phpunit
  Files folder image Files  
File Role Description
Files folder imagesrc (2 directories)
Files folder imagetests (1 file, 3 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .php_cs Aux. Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageComponent (6 files)
Files folder imageElement (16 files)

  Files folder image Files  /  src  /  Component  
File Role Description
  Plain text file AbstractComponent.php Class Class source
  Plain text file GenerableInterface.php Class Class source
  Plain text file PhpClass.php Class Class source
  Plain text file PhpFile.php Class Class source
  Plain text file PhpInterface.php Class Class source
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  /  Element  
File Role Description
  Plain text file AbstractAccessRestrictedElement.php Class Class source
  Plain text file AbstractAssignedValueElement.php Class Class source
  Plain text file AbstractElement.php Class Class source
  Plain text file GenerableInterface.php Class Class source
  Plain text file PhpAnnotation.php Class Class source
  Plain text file PhpAnnotationBlock.php Class Class source
  Plain text file PhpClass.php Class Class source
  Plain text file PhpConstant.php Class Class source
  Plain text file PhpFile.php Class Class source
  Plain text file PhpFunction.php Class Class source
  Plain text file PhpFunctionParameter.php Class Class source
  Plain text file PhpInterface.php Class Class source
  Plain text file PhpMethod.php Class Class source
  Plain text file PhpProperty.php Class Class source
  Plain text file PhpVariable.php Class Class source
  Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  tests  
File Role Description
Files folder imageComponent (4 files)
Files folder imageElement (11 files)
Files folder imageresources (4 files)
  Accessible without login Plain text file TestCase.php Test Unit test script

  Files folder image Files  /  tests  /  Component  
File Role Description
  Accessible without login Plain text file AbstractComponent.php Test Unit test script
  Accessible without login Plain text file PhpClassTest.php Test Unit test script
  Accessible without login Plain text file PhpFileTest.php Test Unit test script
  Accessible without login Plain text file PhpInterfaceTest.php Test Unit test script

  Files folder image Files  /  tests  /  Element  
File Role Description
  Accessible without login Plain text file PhpAnnotationBlockTest.php Test Unit test script
  Accessible without login Plain text file PhpAnnotationTest.php Test Unit test script
  Accessible without login Plain text file PhpClassTest.php Test Unit test script
  Accessible without login Plain text file PhpConstantTest.php Test Unit test script
  Accessible without login Plain text file PhpFileTest.php Test Unit test script
  Accessible without login Plain text file PhpFunctionParameterTest.php Test Unit test script
  Accessible without login Plain text file PhpFunctionTest.php Test Unit test script
  Accessible without login Plain text file PhpInterfaceTest.php Test Unit test script
  Accessible without login Plain text file PhpMethodTest.php Test Unit test script
  Accessible without login Plain text file PhpPropertyTest.php Test Unit test script
  Accessible without login Plain text file PhpVariableTest.php Test Unit test script

  Files folder image Files  /  tests  /  resources  
File Role Description
  Accessible without login Plain text file PhpClassTest_SimpleToString.php Test Unit test script
  Accessible without login Plain text file PhpFileTest_SimpleClassToString.php Test Unit test script
  Accessible without login Plain text file PhpFileTest_SimpleInterfaceToString.php Test Unit test script
  Accessible without login Plain text file PhpInterfaceTest_SimpleToString.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:310
This week:2
All time:6,989
This week:345Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:-
Tests:83%StarStarStarStarStar
Videos:-
Overall:70%StarStarStarStar
Rank:303