Download the PHP package benrowe/properties without Composer
On this page you can find all versions of the php package benrowe/properties. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download benrowe/properties
More information about benrowe/properties
Files in benrowe/properties
Download benrowe/properties
More information about benrowe/properties
Files in benrowe/properties
Vendor benrowe
Package properties
Short Description A simple runtime package for handling properties on a class
License MIT
Homepage https://github.com/benrowe/properties
Package properties
Short Description A simple runtime package for handling properties on a class
License MIT
Homepage https://github.com/benrowe/properties
Please rate this library. Is it a good library?
Informations about the package properties
Properties
Adds the ability to add properties to a class at runtime.
Install
Via Composer
Usage
Each property is defined programatically (at runtime), and requires the class to run this code (with a hook).
Each property can have a
- name:string
- data type(s): string
- validation: string|closure
- setter: closure
- getter:string
- default value (null): mixed
- value: mixed (depends on data type/validation/setter)
TODO
- add the ability for a setter to reject a value by throwing an exception
- build custom validation support for setting the value
- instead of providing a closure for the setter, provide a laravel style validation string.
- add a helper function to restrict the setter to a list of known values
$this->addProperty('key')->isIn(['foo', 'bar']);
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Ben Rowe
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of properties with dependencies
PHP Build Version
Package Version
Requires
php Version
~7.1
The package benrowe/properties contains the following files
Loading the files please wait ....