Download the PHP package grottopress/setter without Composer
On this page you can find all versions of the php package grottopress/setter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download grottopress/setter
More information about grottopress/setter
Files in grottopress/setter
Download grottopress/setter
More information about grottopress/setter
Files in grottopress/setter
Vendor grottopress
Package setter
Short Description Set private object attributes directly, without calling setter methods.
License MIT
Package setter
Short Description Set private object attributes directly, without calling setter methods.
License MIT
Please rate this library. Is it a good library?
Informations about the package setter
Setter
Description
Setter allows you to set private object attributes directly, without calling setter methods.
For example, instead of calling $myObject->setMyAttr($newValue)
, you can just do $myObject->myAttr = $newValue
. Under the hood, Setter sets your attribute by calling a private setMyAttr()
method that you define in your class.
This way, you get the benefit of syntactic sugar, while maintaining encapsulation.
Installation
Install via composer:
Usage
Import trait into your class, and use thus:
Development
Run tests with composer run test
.
Contributing
- Fork it
- Switch to the
master
branch:git checkout master
- Create your feature branch:
git checkout -b my-new-feature
- Make your changes, updating changelog and documentation as appropriate.
- Commit your changes:
git commit
- Push to the branch:
git push origin my-new-feature
- Submit a new Pull Request against the
GrottoPress:master
branch.
All versions of setter with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
The package grottopress/setter contains the following files
Loading the files please wait ....