Skip to content

Commit

Permalink
[10.x] Remove autoload dumping from make:migration (#46215)
Browse files Browse the repository at this point in the history
* Removes composer autoload generation from make:migration commands

* wip

* wip

* Deprecates composer property
  • Loading branch information
timacdonald authored Feb 23, 2023
1 parent 4435269 commit 2f8a22c
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Cache/Console/CacheTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class CacheTableCommand extends Command

/**
* @var \Illuminate\Support\Composer
*
* @deprecated Will be removed in a future Laravel version.
*/
protected $composer;

Expand Down Expand Up @@ -63,8 +65,6 @@ public function handle()
$this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/cache.stub'));

$this->components->info('Migration created successfully.');

$this->composer->dumpAutoloads();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class MigrateMakeCommand extends BaseCommand implements PromptsForMissingInput
* The Composer instance.
*
* @var \Illuminate\Support\Composer
*
* @deprecated Will be removed in a future Laravel version.
*/
protected $composer;

Expand Down Expand Up @@ -93,8 +95,6 @@ public function handle()
// the migration out, we will dump-autoload for the entire framework to
// make sure that the migrations are registered by the class loaders.
$this->writeMigration($name, $table, $create);

$this->composer->dumpAutoloads();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class NotificationTableCommand extends Command

/**
* @var \Illuminate\Support\Composer
*
* @deprecated Will be removed in a future Laravel version.
*/
protected $composer;

Expand Down Expand Up @@ -63,8 +65,6 @@ public function handle()
$this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/notifications.stub'));

$this->components->info('Migration created successfully.');

$this->composer->dumpAutoloads();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/Console/BatchesTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class BatchesTableCommand extends Command

/**
* @var \Illuminate\Support\Composer
*
* @deprecated Will be removed in a future Laravel version.
*/
protected $composer;

Expand Down Expand Up @@ -65,8 +67,6 @@ public function handle()
);

$this->components->info('Migration created successfully.');

$this->composer->dumpAutoloads();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/Console/FailedTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class FailedTableCommand extends Command

/**
* @var \Illuminate\Support\Composer
*
* @deprecated Will be removed in a future Laravel version.
*/
protected $composer;

Expand Down Expand Up @@ -65,8 +67,6 @@ public function handle()
);

$this->components->info('Migration created successfully.');

$this->composer->dumpAutoloads();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/Console/TableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class TableCommand extends Command

/**
* @var \Illuminate\Support\Composer
*
* @deprecated Will be removed in a future Laravel version.
*/
protected $composer;

Expand Down Expand Up @@ -65,8 +67,6 @@ public function handle()
);

$this->components->info('Migration created successfully.');

$this->composer->dumpAutoloads();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Session/Console/SessionTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class SessionTableCommand extends Command

/**
* @var \Illuminate\Support\Composer
*
* @deprecated Will be removed in a future Laravel version.
*/
protected $composer;

Expand Down Expand Up @@ -63,8 +65,6 @@ public function handle()
$this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/database.stub'));

$this->components->info('Migration created successfully.');

$this->composer->dumpAutoloads();
}

/**
Expand Down
1 change: 0 additions & 1 deletion tests/Cache/CacheTableCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function testCreateMakesMigration()
$creator->shouldReceive('create')->once()->with('create_cache_table', $path)->andReturn($path);
$files->shouldReceive('get')->once()->andReturn('foo');
$files->shouldReceive('put')->once()->with($path, 'foo');
$composer->shouldReceive('dumpAutoloads')->once();

$this->runCommand($command);
}
Expand Down
1 change: 0 additions & 1 deletion tests/Database/DatabaseMigrationMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function testBasicCreateDumpsAutoload()
$creator->shouldReceive('create')->once()
->with('create_foo', __DIR__.DIRECTORY_SEPARATOR.'migrations', 'foo', true)
->andReturn(__DIR__.'/migrations/2021_04_23_110457_create_foo.php');
$composer->shouldReceive('dumpAutoloads')->once();

$this->runCommand($command, ['name' => 'create_foo']);
}
Expand Down
1 change: 0 additions & 1 deletion tests/Session/SessionTableCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function testCreateMakesMigration()
$creator->shouldReceive('create')->once()->with('create_sessions_table', $path)->andReturn($path);
$files->shouldReceive('get')->once()->andReturn('foo');
$files->shouldReceive('put')->once()->with($path, 'foo');
$composer->shouldReceive('dumpAutoloads')->once();

$this->runCommand($command);
}
Expand Down

0 comments on commit 2f8a22c

Please sign in to comment.