Skip to content

Commit

Permalink
TASK: support custom loader
Browse files Browse the repository at this point in the history
  • Loading branch information
simstern committed Jan 12, 2023
1 parent 30798cc commit 324ca46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Context
* @param ObjectManagerInterface $objectManager Object manager for constructor injection
* @param bool $persistenceEnabled Flag to enable persistence of objects
*/
public function __construct(ObjectManagerInterface $objectManager, bool $persistenceEnabled = false)
public function __construct(ObjectManagerInterface $objectManager, bool $persistenceEnabled = false, ?NativeLoader $loader = null)
{
$this->persistenceEnabled = $persistenceEnabled;

Expand All @@ -55,7 +55,7 @@ public function __construct(ObjectManagerInterface $objectManager, bool $persist

$this->settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Swisscom.AliceConnector');

$this->loader = new NativeLoader();
$this->loader = $loader ?: new NativeLoader();
$this->faker = $this->loader->getFakerGenerator();

foreach ($this->settings['fakerProviders'] as $fakerProviderSetting) {
Expand Down

0 comments on commit 324ca46

Please sign in to comment.