src/mako/application/cli/commands/migrations/Command.php
protected function runMigration(object $migration, string $method, ?int $batch = null): void
	{
		$migrationInstance = $this->resolve($migration);

		$migrationWrapper = $this->buildMigrationWrapper($migration, $migrationInstance, $method, $batch);

		if($migrationInstance->useTransaction())
		{
			$migrationInstance->getConnection()->transaction(function() use ($migrationWrapper): void
			{
				$migrationWrapper();
			});

			return;
		}

		$migrationWrapper();
	}
protected function runMigration(object $migration, string $method, ?int $batch = null): void
	{
		$migrationInstance = $this->resolve($migration);

		$migrationWrapper = $this->buildMigrationWrapper($migration, $migrationInstance, $method, $batch);

		if($migrationInstance->useTransaction())
		{
			$migrationInstance->getConnection()->transaction(function() use ($migrationWrapper): void
			{
				$migrationWrapper();
			});

			return;
		}

		$migrationWrapper();
	}
protected function runMigration ( object $ migration , string $ method , ? int $ batch = null ) : void { $ migrationInstance = $ this -> resolve ( $ migration ) ; $ migrationWrapper = $ this -> buildMigrationWrapper ( $ migration , $ migrationInstance , $ method , $ batch ) ; if ( $ migrationInstance -> useTransaction ( ) ) { $ migrationInstance -> getConnection ( ) -> transaction ( function ( ) use ( $ migrationWrapper ) : void { $ migrationWrapper ( ) ; } ) ; return ; } $ migrationWrapper ( ) ; }
Executes a migration method.

@param object   $migration Migration meta
@param string   $method    Migration method
@param int|null $batch     Batch
Executes a migration method .