Skip to content

Commit

Permalink
Change to null-coalescing assignment for memoization.
Browse files Browse the repository at this point in the history
Should be effectively the same?
  • Loading branch information
adam-vessey committed Dec 5, 2024
1 parent 10eb8a8 commit 454e1f8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Plugin/migrate/source/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ public static function create(ContainerInterface $container, array $configuratio
* The target migration.
*/
protected function getTargetMigration() : MigrationInterface {
if (!isset($this->targetMigration)) {
$this->targetMigration = $this->migrationPluginManager->createInstance($this->configuration['migration']);
}

return $this->targetMigration;
return $this->targetMigration ??= $this->migrationPluginManager->createInstance($this->configuration['migration']);
}

/**
Expand Down

0 comments on commit 454e1f8

Please sign in to comment.