|
10 | 10 | use AutoMapper\Loader\ClassLoaderInterface; |
11 | 11 | use AutoMapper\Loader\EvalLoader; |
12 | 12 | use AutoMapper\Loader\FileLoader; |
| 13 | +use AutoMapper\Loader\FileReloadStrategy; |
13 | 14 | use AutoMapper\Metadata\MetadataFactory; |
14 | 15 | use AutoMapper\Metadata\MetadataRegistry; |
15 | 16 | use AutoMapper\Provider\ProviderInterface; |
@@ -132,6 +133,7 @@ public static function create( |
132 | 133 | ExpressionLanguageProvider $expressionLanguageProvider = null, |
133 | 134 | EventDispatcherInterface $eventDispatcher = new EventDispatcher(), |
134 | 135 | iterable $providers = [], |
| 136 | + FileReloadStrategy $reloadStrategy = FileReloadStrategy::ON_CHANGE, |
135 | 137 | ): AutoMapperInterface { |
136 | 138 | if (\count($transformerFactories) > 0) { |
137 | 139 | trigger_deprecation('jolicode/automapper', '9.0', 'The "$transformerFactories" property will be removed in version 10.0, AST transformer factories must be included within AutoMapper.', __METHOD__); |
@@ -188,7 +190,7 @@ public static function create( |
188 | 190 | if (null === $cacheDirectory) { |
189 | 191 | $loader = new EvalLoader($mapperGenerator, $metadataFactory); |
190 | 192 | } else { |
191 | | - $loader = new FileLoader($mapperGenerator, $metadataFactory, $cacheDirectory, $lockFactory); |
| 193 | + $loader = new FileLoader($mapperGenerator, $metadataFactory, $cacheDirectory, $lockFactory, $reloadStrategy); |
192 | 194 | } |
193 | 195 |
|
194 | 196 | return new self($loader, $customTransformerRegistry, $metadataRegistry, $providerRegistry, $expressionLanguageProvider); |
|
0 commit comments