Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
/ simple-php-code-gen Public archive

simple PHP code generator; generates namespaced classes with properties

Notifications You must be signed in to change notification settings

gotohr/simple-php-code-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Usage:

$cg = new \GoToHr\SimpleCodeGen\CodeGenerator(array(
	'ns' => 'simple\\testns',
	'classes' => array (
		'Hello' => array(
			'properties' => array(
				'first' => array('type' => 'string'),
				'second' => array('type' => 'int'),
			),
			'methods' => array(
				'call_me' => array(),
				'sometimes' => array(
					'params' => array(
						'there' => array(),
						'here' => array('default' => 'null')
					)
				)
			)
		),
		'World' => array(
			'extends' => '\\simple\\testns\\Hello',
			'properties' => array(
				'fun' => array('type' => 'string'),
				'stuff' => array('type' => 'int'),
			)
		)
	)
));

$cg->generate();

// or this way...

$ct = new \GoToHr\SimpleCodeGen\ClassTemplate('test', 'testns');
$ct->addProperty('first', 'string');
//$ct->write();
echo $ct;

About

simple PHP code generator; generates namespaced classes with properties

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages