Download the PHP package kzykhys/php-class-generator without Composer
On this page you can find all versions of the php package kzykhys/php-class-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kzykhys/php-class-generator
More information about kzykhys/php-class-generator
Files in kzykhys/php-class-generator
Download kzykhys/php-class-generator
More information about kzykhys/php-class-generator
Files in kzykhys/php-class-generator
Vendor kzykhys
Package php-class-generator
Short Description Generate PSR compliant classes from plain text document
License MIT
Package php-class-generator
Short Description Generate PSR compliant classes from plain text document
License MIT
Please rate this library. Is it a good library?
Informations about the package php-class-generator
PHP Class Generator
Generate PSR compliant classes from plain text document
Requirements
- PHP 5.3.3 +
Installation
Download phar
Download php-cg.phar and store anywhere.
via Composer
Usage
Write your class and save the text file to *.pcg (Syntax is described below)
For example ./doc/myclass.pcg
Run the command
PHP file will be generated to ./src/Full/Qualified/ClassName.php
The Syntax
Overview
- Class Definition (required)
- Field Definition (optionai)
- Method Definition (optional)
Class Definition (required)
%ClassName%
is required ** If your class is in the namespace,%ClassName%
will be like this\\Namespace\\Package\\ClassName
<
representsextends
%BaseClassName%
is optional<<
representsimplements
%InterfaceName%
is optional>
starts comment to end of the line- You can place comments to same line and next line of class definition
Field Definition (optional)
%FieldVisibility%
is required%FieldVisibility%
takes+
as public#
as protected-
as private%FieldName%
is required%FieldType%
is optional%FieldAccessor%
takesset
,bind
as setter,get
,is
as getter>
starts comment to end of the line- You can place comments to same line and next line of field definition
Method Definition (optionai)
%MethodVisibility%
is required%MethodVisibility%
takes+
as public#
as protected-
as private%MethodName%
is required- Braces
()
are required (even if there is no argument) %Argument%
and%ArgumentType%
is optional%ReturnType%
is optional
Write a Readable Document
You can use any white spaces to write a readable document
Following code is same as the code used in Usage
Build Phar Archive
You can build phar archive from source code by following command
If fails like this
Run following
Notes
- Class constant is not supported yet.
- Implementation of interface is not generated automatically.
Author
Kazuyuki Hayashi (@kzykhys)
All versions of php-class-generator with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.3
symfony/console Version 2.1.*
symfony/filesystem Version 2.1.*
symfony/finder Version 2.1.*
symfony/console Version 2.1.*
symfony/filesystem Version 2.1.*
symfony/finder Version 2.1.*
The package kzykhys/php-class-generator contains the following files
Loading the files please wait ....