diff --git a/src/FileMigrationHelper.php b/src/FileMigrationHelper.php index 8a25fcb8..bfcd53b5 100644 --- a/src/FileMigrationHelper.php +++ b/src/FileMigrationHelper.php @@ -36,9 +36,20 @@ class FileMigrationHelper */ private static $delete_invalid_files = true; + private static $dependencies = [ + 'logger' => '%$' . LoggerInterface::class, + ]; + /** @var LoggerInterface */ private $logger; + /** + * @param LoggerInterface $logger + */ + public function setLogger(LoggerInterface $logger) { + $this->logger = $logger; + } + /** * Perform migration * @@ -61,8 +72,6 @@ public function run($base = null) Environment::increaseTimeLimitTo(); Environment::increaseMemoryLimitTo(); - $this->logger = Injector::inst()->get(LoggerInterface::class); - // Loop over all files $processedCount = $migratedCount = 0; $originalState = null;