From 3f03d3f4adf30ac4fe4a0692f0fbb2c64ca3fb47 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 22 Feb 2023 11:24:40 +1100 Subject: [PATCH 1/4] Removes composer autoload generation from make:migration commands --- src/Illuminate/Cache/Console/CacheTableCommand.php | 2 -- .../Database/Console/Migrations/MigrateMakeCommand.php | 2 -- .../Notifications/Console/NotificationTableCommand.php | 2 -- src/Illuminate/Queue/Console/BatchesTableCommand.php | 2 -- src/Illuminate/Queue/Console/FailedTableCommand.php | 2 -- src/Illuminate/Queue/Console/TableCommand.php | 2 -- 6 files changed, 12 deletions(-) diff --git a/src/Illuminate/Cache/Console/CacheTableCommand.php b/src/Illuminate/Cache/Console/CacheTableCommand.php index 3db70896cacc..e439b8d937b3 100644 --- a/src/Illuminate/Cache/Console/CacheTableCommand.php +++ b/src/Illuminate/Cache/Console/CacheTableCommand.php @@ -63,8 +63,6 @@ public function handle() $this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/cache.stub')); $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); } /** diff --git a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php index 75c06345b1bd..e87197892ace 100644 --- a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php +++ b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php @@ -93,8 +93,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(); } /** diff --git a/src/Illuminate/Notifications/Console/NotificationTableCommand.php b/src/Illuminate/Notifications/Console/NotificationTableCommand.php index dd70cdbfabb0..89570a212e8a 100644 --- a/src/Illuminate/Notifications/Console/NotificationTableCommand.php +++ b/src/Illuminate/Notifications/Console/NotificationTableCommand.php @@ -63,8 +63,6 @@ public function handle() $this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/notifications.stub')); $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); } /** diff --git a/src/Illuminate/Queue/Console/BatchesTableCommand.php b/src/Illuminate/Queue/Console/BatchesTableCommand.php index a11a32366192..2ff88cfa0380 100644 --- a/src/Illuminate/Queue/Console/BatchesTableCommand.php +++ b/src/Illuminate/Queue/Console/BatchesTableCommand.php @@ -65,8 +65,6 @@ public function handle() ); $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); } /** diff --git a/src/Illuminate/Queue/Console/FailedTableCommand.php b/src/Illuminate/Queue/Console/FailedTableCommand.php index fbddbae71864..7241b6dba73b 100644 --- a/src/Illuminate/Queue/Console/FailedTableCommand.php +++ b/src/Illuminate/Queue/Console/FailedTableCommand.php @@ -65,8 +65,6 @@ public function handle() ); $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); } /** diff --git a/src/Illuminate/Queue/Console/TableCommand.php b/src/Illuminate/Queue/Console/TableCommand.php index 1c28e7a56fbb..e02a2814e7ea 100644 --- a/src/Illuminate/Queue/Console/TableCommand.php +++ b/src/Illuminate/Queue/Console/TableCommand.php @@ -65,8 +65,6 @@ public function handle() ); $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); } /** From 0232c09f8adb8f3c4c58a7e215039a28414aaff9 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 22 Feb 2023 13:10:01 +1100 Subject: [PATCH 2/4] wip --- src/Illuminate/Session/Console/SessionTableCommand.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Illuminate/Session/Console/SessionTableCommand.php b/src/Illuminate/Session/Console/SessionTableCommand.php index da64d56e0934..b5c37ffd6518 100644 --- a/src/Illuminate/Session/Console/SessionTableCommand.php +++ b/src/Illuminate/Session/Console/SessionTableCommand.php @@ -63,8 +63,6 @@ public function handle() $this->files->put($fullPath, $this->files->get(__DIR__.'/stubs/database.stub')); $this->components->info('Migration created successfully.'); - - $this->composer->dumpAutoloads(); } /** From 22d298664fea9eae131619f0e93ab398ceb453c4 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 22 Feb 2023 13:14:51 +1100 Subject: [PATCH 3/4] wip --- tests/Cache/CacheTableCommandTest.php | 1 - tests/Database/DatabaseMigrationMakeCommandTest.php | 1 - tests/Session/SessionTableCommandTest.php | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/Cache/CacheTableCommandTest.php b/tests/Cache/CacheTableCommandTest.php index 4a00a2f5999b..927acacd47c8 100644 --- a/tests/Cache/CacheTableCommandTest.php +++ b/tests/Cache/CacheTableCommandTest.php @@ -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); } diff --git a/tests/Database/DatabaseMigrationMakeCommandTest.php b/tests/Database/DatabaseMigrationMakeCommandTest.php index d655a20927ae..2ac5dde1b453 100755 --- a/tests/Database/DatabaseMigrationMakeCommandTest.php +++ b/tests/Database/DatabaseMigrationMakeCommandTest.php @@ -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']); } diff --git a/tests/Session/SessionTableCommandTest.php b/tests/Session/SessionTableCommandTest.php index 8bb1081c933d..db7be0998ca3 100644 --- a/tests/Session/SessionTableCommandTest.php +++ b/tests/Session/SessionTableCommandTest.php @@ -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); } From ad6c16c061d449be93bd554c2bdac7a2ff83b1b6 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Thu, 23 Feb 2023 09:14:29 +1100 Subject: [PATCH 4/4] Deprecates composer property --- src/Illuminate/Cache/Console/CacheTableCommand.php | 2 ++ .../Database/Console/Migrations/MigrateMakeCommand.php | 2 ++ .../Notifications/Console/NotificationTableCommand.php | 2 ++ src/Illuminate/Queue/Console/BatchesTableCommand.php | 2 ++ src/Illuminate/Queue/Console/FailedTableCommand.php | 2 ++ src/Illuminate/Queue/Console/TableCommand.php | 2 ++ src/Illuminate/Session/Console/SessionTableCommand.php | 2 ++ 7 files changed, 14 insertions(+) diff --git a/src/Illuminate/Cache/Console/CacheTableCommand.php b/src/Illuminate/Cache/Console/CacheTableCommand.php index e439b8d937b3..ca69f4e79aee 100644 --- a/src/Illuminate/Cache/Console/CacheTableCommand.php +++ b/src/Illuminate/Cache/Console/CacheTableCommand.php @@ -33,6 +33,8 @@ class CacheTableCommand extends Command /** * @var \Illuminate\Support\Composer + * + * @deprecated Will be removed in a future Laravel version. */ protected $composer; diff --git a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php index e87197892ace..ea6b340ffb45 100644 --- a/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php +++ b/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php @@ -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; diff --git a/src/Illuminate/Notifications/Console/NotificationTableCommand.php b/src/Illuminate/Notifications/Console/NotificationTableCommand.php index 89570a212e8a..7985c40b474f 100644 --- a/src/Illuminate/Notifications/Console/NotificationTableCommand.php +++ b/src/Illuminate/Notifications/Console/NotificationTableCommand.php @@ -33,6 +33,8 @@ class NotificationTableCommand extends Command /** * @var \Illuminate\Support\Composer + * + * @deprecated Will be removed in a future Laravel version. */ protected $composer; diff --git a/src/Illuminate/Queue/Console/BatchesTableCommand.php b/src/Illuminate/Queue/Console/BatchesTableCommand.php index 2ff88cfa0380..8c5d81c45b11 100644 --- a/src/Illuminate/Queue/Console/BatchesTableCommand.php +++ b/src/Illuminate/Queue/Console/BatchesTableCommand.php @@ -33,6 +33,8 @@ class BatchesTableCommand extends Command /** * @var \Illuminate\Support\Composer + * + * @deprecated Will be removed in a future Laravel version. */ protected $composer; diff --git a/src/Illuminate/Queue/Console/FailedTableCommand.php b/src/Illuminate/Queue/Console/FailedTableCommand.php index 7241b6dba73b..fdeaffdb4fbc 100644 --- a/src/Illuminate/Queue/Console/FailedTableCommand.php +++ b/src/Illuminate/Queue/Console/FailedTableCommand.php @@ -33,6 +33,8 @@ class FailedTableCommand extends Command /** * @var \Illuminate\Support\Composer + * + * @deprecated Will be removed in a future Laravel version. */ protected $composer; diff --git a/src/Illuminate/Queue/Console/TableCommand.php b/src/Illuminate/Queue/Console/TableCommand.php index e02a2814e7ea..dbbb59004765 100644 --- a/src/Illuminate/Queue/Console/TableCommand.php +++ b/src/Illuminate/Queue/Console/TableCommand.php @@ -33,6 +33,8 @@ class TableCommand extends Command /** * @var \Illuminate\Support\Composer + * + * @deprecated Will be removed in a future Laravel version. */ protected $composer; diff --git a/src/Illuminate/Session/Console/SessionTableCommand.php b/src/Illuminate/Session/Console/SessionTableCommand.php index b5c37ffd6518..9b0c9b66b598 100644 --- a/src/Illuminate/Session/Console/SessionTableCommand.php +++ b/src/Illuminate/Session/Console/SessionTableCommand.php @@ -33,6 +33,8 @@ class SessionTableCommand extends Command /** * @var \Illuminate\Support\Composer + * + * @deprecated Will be removed in a future Laravel version. */ protected $composer;