Skip to content

Commit 2f8a22c

Browse files
authored
[10.x] Remove autoload dumping from make:migration (#46215)
* Removes composer autoload generation from make:migration commands * wip * wip * Deprecates composer property
1 parent 4435269 commit 2f8a22c

File tree

10 files changed

+14
-17
lines changed

10 files changed

+14
-17
lines changed

src/Illuminate/Cache/Console/CacheTableCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class CacheTableCommand extends Command
3333

3434
/**
3535
* @var \Illuminate\Support\Composer
36+
*
37+
* @deprecated Will be removed in a future Laravel version.
3638
*/
3739
protected $composer;
3840

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

6567
$this->components->info('Migration created successfully.');
66-
67-
$this->composer->dumpAutoloads();
6868
}
6969

7070
/**

src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class MigrateMakeCommand extends BaseCommand implements PromptsForMissingInput
3939
* The Composer instance.
4040
*
4141
* @var \Illuminate\Support\Composer
42+
*
43+
* @deprecated Will be removed in a future Laravel version.
4244
*/
4345
protected $composer;
4446

@@ -93,8 +95,6 @@ public function handle()
9395
// the migration out, we will dump-autoload for the entire framework to
9496
// make sure that the migrations are registered by the class loaders.
9597
$this->writeMigration($name, $table, $create);
96-
97-
$this->composer->dumpAutoloads();
9898
}
9999

100100
/**

src/Illuminate/Notifications/Console/NotificationTableCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class NotificationTableCommand extends Command
3333

3434
/**
3535
* @var \Illuminate\Support\Composer
36+
*
37+
* @deprecated Will be removed in a future Laravel version.
3638
*/
3739
protected $composer;
3840

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

6567
$this->components->info('Migration created successfully.');
66-
67-
$this->composer->dumpAutoloads();
6868
}
6969

7070
/**

src/Illuminate/Queue/Console/BatchesTableCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class BatchesTableCommand extends Command
3333

3434
/**
3535
* @var \Illuminate\Support\Composer
36+
*
37+
* @deprecated Will be removed in a future Laravel version.
3638
*/
3739
protected $composer;
3840

@@ -65,8 +67,6 @@ public function handle()
6567
);
6668

6769
$this->components->info('Migration created successfully.');
68-
69-
$this->composer->dumpAutoloads();
7070
}
7171

7272
/**

src/Illuminate/Queue/Console/FailedTableCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class FailedTableCommand extends Command
3333

3434
/**
3535
* @var \Illuminate\Support\Composer
36+
*
37+
* @deprecated Will be removed in a future Laravel version.
3638
*/
3739
protected $composer;
3840

@@ -65,8 +67,6 @@ public function handle()
6567
);
6668

6769
$this->components->info('Migration created successfully.');
68-
69-
$this->composer->dumpAutoloads();
7070
}
7171

7272
/**

src/Illuminate/Queue/Console/TableCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class TableCommand extends Command
3333

3434
/**
3535
* @var \Illuminate\Support\Composer
36+
*
37+
* @deprecated Will be removed in a future Laravel version.
3638
*/
3739
protected $composer;
3840

@@ -65,8 +67,6 @@ public function handle()
6567
);
6668

6769
$this->components->info('Migration created successfully.');
68-
69-
$this->composer->dumpAutoloads();
7070
}
7171

7272
/**

src/Illuminate/Session/Console/SessionTableCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class SessionTableCommand extends Command
3333

3434
/**
3535
* @var \Illuminate\Support\Composer
36+
*
37+
* @deprecated Will be removed in a future Laravel version.
3638
*/
3739
protected $composer;
3840

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

6567
$this->components->info('Migration created successfully.');
66-
67-
$this->composer->dumpAutoloads();
6868
}
6969

7070
/**

tests/Cache/CacheTableCommandTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function testCreateMakesMigration()
3535
$creator->shouldReceive('create')->once()->with('create_cache_table', $path)->andReturn($path);
3636
$files->shouldReceive('get')->once()->andReturn('foo');
3737
$files->shouldReceive('put')->once()->with($path, 'foo');
38-
$composer->shouldReceive('dumpAutoloads')->once();
3938

4039
$this->runCommand($command);
4140
}

tests/Database/DatabaseMigrationMakeCommandTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public function testBasicCreateDumpsAutoload()
3030
$creator->shouldReceive('create')->once()
3131
->with('create_foo', __DIR__.DIRECTORY_SEPARATOR.'migrations', 'foo', true)
3232
->andReturn(__DIR__.'/migrations/2021_04_23_110457_create_foo.php');
33-
$composer->shouldReceive('dumpAutoloads')->once();
3433

3534
$this->runCommand($command, ['name' => 'create_foo']);
3635
}

tests/Session/SessionTableCommandTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function testCreateMakesMigration()
3535
$creator->shouldReceive('create')->once()->with('create_sessions_table', $path)->andReturn($path);
3636
$files->shouldReceive('get')->once()->andReturn('foo');
3737
$files->shouldReceive('put')->once()->with($path, 'foo');
38-
$composer->shouldReceive('dumpAutoloads')->once();
3938

4039
$this->runCommand($command);
4140
}

0 commit comments

Comments
 (0)