Download the PHP package ride/lib-generator without Composer
On this page you can find all versions of the php package ride/lib-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ride/lib-generator
More information about ride/lib-generator
Files in ride/lib-generator
Package lib-generator
Short Description Code generator library of the Ride framework
License MIT
Informations about the package lib-generator
Ride: Code Generator Library
Code generator library of the PHP Ride framework.
What's In This Library
CodeGenerator
The CodeGenerator interface is the main interface of this library. You can use it to create classes, methods, properties and variables. After setting up you class, you can pass it to the generateClass method to get the PHP code.
CodeClass
The CodeClass interface is the representation of a class or interface. You can add constants, properties and methods to it. When done, you can pass it to the generateClass method of a CodeGenerator to get the PHP code.
CodeMethod
The CodeMethod interface is the representation of a class method. You can add arguments to it, set whether it's abstract or static, set the source, ... When the method is defined, you can add it to a CodeClass instance.
CodeProperty
The CodeProperty interface is the representation of a class property. It extends from the CodeVariable interface and can thus be used as a variable as well. The difference between the two is that a property has a scope.
CodeVariable
The CodeVariable interface is the representation of a variable. It can be used for a class constant, a method argument or a return value.
Code Sample
Check this code sample to see some possibilities of this library:
This function will generate the following PHP code:
Installation
You can use Composer to install this library.