Download the PHP package yucadoo/polymorphic-fractal without Composer
On this page you can find all versions of the php package yucadoo/polymorphic-fractal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yucadoo/polymorphic-fractal
More information about yucadoo/polymorphic-fractal
Files in yucadoo/polymorphic-fractal
Package polymorphic-fractal
Short Description Polymorphic Transformer implementation for PHP League's Fractal package.
License MIT
Homepage https://github.com/yucadoo/polymorphic-fractal
Informations about the package polymorphic-fractal
Polymorphic Fractal Transformer
Polymorphic transformer implementation for PHP League's Fractal package. Useful for feeds, e.g. notification feed. The polymorphic transformer can be used as any other transformer and is therefore compatible with packages built on top of Fractal. This package is compliant with PSR-1, PSR-2, PSR-4 and PSR-11. If you notice compliance oversights, please send a patch via pull request.
Install
Via Composer
Usage
As shown in the example above the class of the transformation data is used to get the transformer from the transformer registry. This behvaiour can be modified by overriding the getRegistryKey() method.
Pro tip
To prevent repeated instantiation of the same transformer wrap your framework's IoC cointainer with the SingletonContainer decorator provided by the yucadoo/singleton-container package before passing it into the AliasContainer.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Hrvoje Jukic
- All Contributors
License
The MIT License (MIT). Please see License File for more information.