diff --git a/docs/guide/en/attribute-resolver-factory.md b/docs/guide/en/attribute-resolver-factory.md index b49845c..e27e3f2 100644 --- a/docs/guide/en/attribute-resolver-factory.md +++ b/docs/guide/en/attribute-resolver-factory.md @@ -1,22 +1,16 @@ # Attribute resolver factory -The hydrator uses `AttributeResolverFactoryInterface` implementation to create attribute resolvers. The package provides two -implementations out of the box. +The hydrator uses `AttributeResolverFactoryInterface` implementation to create attribute resolvers. +The package provides two implementations out of the box: -## Attribute resolver factories out of the box +- `ReflectionAttributeResolverFactory`. Uses reflection to create attribute resolver, and can create attribute resolvers + without dependencies only. +- `ContainerAttributeResolverFactory`. Uses [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible DI container + to create attribute resolver. -### `ReflectionAttributeResolverFactory` - -It uses reflection to create attribute resolver, and can create attribute resolvers without dependencies only. - -### `ContainerAttributeResolverFactory` - -It uses PSR-11 compatible DI container to create attribute resolver. - -## Default attribute resolver factory - -It depends on environment. When using hydrator package within the Yii ecosystem (an application uses -[Yii Config](https://github.com/yiisoft/config)), by default uses `ContainerAttributeResolverFactory`. Otherwise, it uses `ReflectionAttributeResolverFactory`. +Default factory used depends on the environment. When using hydrator package within the Yii ecosystem (an application +uses [Yii Config](https://github.com/yiisoft/config)), default is `ContainerAttributeResolverFactory`. Otherwise, +it is `ReflectionAttributeResolverFactory`. ## Using attribute resolver factory diff --git a/docs/guide/en/object-factory.md b/docs/guide/en/object-factory.md index bbf5005..435cb61 100644 --- a/docs/guide/en/object-factory.md +++ b/docs/guide/en/object-factory.md @@ -1,18 +1,14 @@ # Object Factory -The hydrator uses `ObjectFactoryInterface` implementation to create object when you uses `Hydrator::create()` method: hydrator passes to factory resolved constructor arguments and gets created object for next hydration. The package provides two implementations out of the box. - -## Object factories out of the box - -### `ReflectionObjectFactory` - -It uses reflection to create object, and cannot create objects when not all constructor arguments are resolved. -This object factory is used by default. - -### `ContainerObjectFactory` - -It uses [Yii Injector](https://github.com/yiisoft/injector) to create object that allow to use PSR-11 compatible -DI container for resolve constructor arguments, which were not resolved by the hydrator. +The hydrator uses `ObjectFactoryInterface` implementation to create object when you use `Hydrator::create()` method: +hydrator passes resolved constructor arguments to factory and obtains created object for next hydration. +The package provides two implementations out of the box: + +- `ReflectionObjectFactory`. Uses reflection to create object. It cannot create objects when some constructor arguments + aren't resolved. This object factory is used by default. +- `ContainerObjectFactory`. Uses [Yii Injector](https://github.com/yiisoft/injector) to create object that allow to use + [PSR-11](https://www.php-fig.org/psr/psr-11/) compatible DI container to resolve constructor argument not resolved + by the hydrator. ## Using object factory