Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.56 KB

README.md

File metadata and controls

42 lines (29 loc) · 1.56 KB

Synthesize

Synthesizer trait to auto generate getter and setter access for objects.

Latest Stable Version Build Status Coverage Status MIT License PHP 5.4 PHP 5.5 PHP 5.6 PHP 7

Install

To install with Composer:

composer require frozensheep/synthesize

Usage

use Frozensheep\Synthesize\Synthesizer;

class Transaction {

	use Synthesizer;

	protected $arrSynthesize = array(
		'amount' => array('type' => 'float'),
		'description' => array('type' => 'string', 'default' => 'Super cool product.')
	};
}

$objTransaction = new Transaction();

$objTransaction->amount = 19.95;
$objTransaction->description = '4x Large Bowls';