Download the PHP package kamilwylegala/immutable-setter without Composer
On this page you can find all versions of the php package kamilwylegala/immutable-setter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kamilwylegala/immutable-setter
More information about kamilwylegala/immutable-setter
Files in kamilwylegala/immutable-setter
Download kamilwylegala/immutable-setter
More information about kamilwylegala/immutable-setter
Files in kamilwylegala/immutable-setter
Vendor kamilwylegala
Package immutable-setter
Short Description Utility class for PHP that helps making your classes immutable.
License MIT
Package immutable-setter
Short Description Utility class for PHP that helps making your classes immutable.
License MIT
Please rate this library. Is it a good library?
Informations about the package immutable-setter
Immutable Setter
Tiny utillity class that helps you making your classes immutable by adding wither methods.
Inspired by Lombok's @Wither annotation.
It lets you easily add witherX
methods to clone object with modified one property.
Installation
Use composer to get library from packagist:
Usage
- Add
wither
field to your class. - Assign
new Wither($this, ["arg1", "arg2"])
to this field and provide constructor schema with proper order of arguments. You can also skip second argument and letWither
resolve constructor arguments automatically. -
Add public
withArg1
method to your class and put: - Running
$valueObject->withArg1($newArg1)
will create copy of your object with changed$arg1
field.
Example
Tests
Install dev dependencies and run in root:
Licence
MIT
All versions of immutable-setter with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4.0
The package kamilwylegala/immutable-setter contains the following files
Loading the files please wait ....