Download the PHP package ekvedaras/class-factory without Composer
On this page you can find all versions of the php package ekvedaras/class-factory. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ekvedaras/class-factory
More information about ekvedaras/class-factory
Files in ekvedaras/class-factory
Package class-factory
Short Description Factory for creating objects via constructor arguments
License MIT
Homepage https://github.com/ekvedaras/class-factory
Informations about the package class-factory
Factory for creating objects via constructor arguments
A factory class that passes each property directly to constructor. This way your class does not need to deal with received array to create itself from and there is no reflection magic involved. This is mostly useful for creating plain classes like value objects, entities, DTOs, etc.
Installation
You can install the package via composer:
PhpStorm plugin
Provides autocomplete and refactoring capabillities for PhpStorm.
- Plugin: ClassFactory
- Repository: class-factory-phpstorm
Usage
Customising class creation
If you don't want class to be created by directly passing attributes to constructor, you can override newInstance
method in the factory and do change the behavior.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ernestas Kvedaras
- All Contributors
License
The MIT License (MIT). Please see License File for more information.