frozensheep/synthesize

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

1.0 2015-12-07 14:11 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:50:32 UTC


README

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';