jojo1981 / data-resolver-handlers
Handlers for the data resolver
Installs: 7 793
Dependents: 0
Suggesters: 1
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- dg/bypass-finals: ^1.3
- doctrine/collections: ^1.6
- jojo1981/data-resolver: ^2.0
- jojo1981/typed-collection: ^5.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.4
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
README
Author: Joost Nijhuis <jnijhuis81@gmail.com>
This library is an extension for the jojo1981/data-resolver
package and contains custom handlers which add support to work with some 3th party libraries.
This library has support for:
- instances of
Doctrine\Common\Collections\Collection
from the packagedoctrine/collections
. - instances of
Jojo1981\TypedCollection\Collection
from the packagejojo1981/typed-collection
.
Installation
Library
git clone https://github.com/jojo1981/data-resolver-handlers.git
Composer
composer require jojo1981/data-resolver-handlers
Usage
<?php require 'vendor/autoload.php'; // get factory and register handlers $factory = (new \Jojo1981\DataResolver\Factory()) ->useDefaultSequenceHandlers() ->registerSequenceHandler(new \Jojo1981\DataResolverHandlers\DoctrineCollectionSequenceHandler()) ->registerSequenceHandler(new \Jojo1981\DataResolverHandlers\TypedCollectionSequenceHandler()) ->setMergeHandler( new \Jojo1981\DataResolverHandlers\DoctrineCollectionMergeHandlerDecorator( new \Jojo1981\DataResolverHandlers\TypedCollectionMergeHandlerDecorator( new \Jojo1981\DataResolver\Handler\MergeHandler\DefaultMergeHandler() ) ) ); // get resolver builder factory $resolverBuilderFactory = $factory->getResolverBuilderFactory(); // and you're ready to go