2017 © Pedro PelĂĄez
 

library php-abstract-structure

Basic data structure with public properties while validating data type.

image

lavoiesl/php-abstract-structure

Basic data structure with public properties while validating data type.

  • Tuesday, April 8, 2014
  • by lavoiesl
  • Repository
  • 1 Watchers
  • 4 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP Abstract Structures

Build Status Scrutinizer Code Quality Code Coverage, (*1)

Basic data structure with public properties while validating data type., (*2)

Inspired from https://medium.com/laravel-4/ef6b7113dd40, (*3)

Usage

Generic structure

Each property will the bind to the type of the first value that is set., (*4)

foo = 1; // initial value
$generic->foo = 2; // type not changing, still good
$generic->foo = 'foo'; // Exception, wrong type
$generic->bar = 'foo'; // Exception, undefined
?>

Defined types

You may override getPropertyType for more granular control., (*5)

id = 1;
$generic->id = null;
$generic->id = 'foo'; // Exception
?>

TODO

Consider adding readonly properties, (*6)

Author

The Versions

08/04 2014

dev-master

9999999-dev

Basic data structure with public properties while validating data type.

  Sources   Download

MIT

08/04 2014

v1.0

1.0.0.0

Basic data structure with public properties while validating data type.

  Sources   Download

MIT