PHPackages                             ride/lib-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ride/lib-generator

ActiveLibrary[Framework](/categories/framework)

ride/lib-generator
==================

Code generator library of the Ride framework

1.1.2(5y ago)15.0k1[1 PRs](https://github.com/all-ride/ride-lib-generator/pulls)6MITPHP

Since Jun 3Pushed 5y ago8 watchersCompare

[ Source](https://github.com/all-ride/ride-lib-generator)[ Packagist](https://packagist.org/packages/ride/lib-generator)[ RSS](/packages/ride-lib-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (11)Used By (6)

Ride: Code Generator Library
============================

[](#ride-code-generator-library)

Code generator library of the PHP Ride framework.

What's In This Library
----------------------

[](#whats-in-this-library)

### CodeGenerator

[](#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

[](#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

[](#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

[](#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

[](#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
-----------

[](#code-sample)

Check this code sample to see some possibilities of this library:

```
