Skip to content

Commit

Permalink
Merge pull request #1468 from delboy1978uk/3.8.x
Browse files Browse the repository at this point in the history
output backslashes
  • Loading branch information
greg0ire authored Nov 18, 2024
2 parents 13b2364 + 2090164 commit 3856beb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/Tools/Console/Command/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ protected function execute(
return 3;
}

$fqcn = $this->getDependencyFactory()->getClassNameGenerator()->generateClassName($namespace);

$fqcn = $this->getDependencyFactory()->getClassNameGenerator()->generateClassName($namespace);
$diffGenerator = $this->getDependencyFactory()->getDiffGenerator();

try {
Expand All @@ -154,12 +153,12 @@ protected function execute(
sprintf('Generated new migration class to "<info>%s</info>"', $path),
'',
sprintf(
'To run just this migration for testing purposes, you can use <info>migrations:execute --up \'%s\'</info>',
'To run just this migration for testing purposes, you can use <info>migrations:execute --up "%s"</info>',
addslashes($fqcn),
),
'',
sprintf(
'To revert the migration you can use <info>migrations:execute --down \'%s\'</info>',
'To revert the migration you can use <info>migrations:execute --down "%s"</info>',
addslashes($fqcn),
),
'',
Expand Down
4 changes: 2 additions & 2 deletions src/Tools/Console/Command/DumpSchemaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ public function execute(
sprintf('Dumped your schema to a new migration class at "<info>%s</info>"', $path),
'',
sprintf(
'To run just this migration for testing purposes, you can use <info>migrations:execute --up \'%s\'</info>',
'To run just this migration for testing purposes, you can use <info>migrations:execute --up "%s"</info>',
addslashes($fqcn),
),
'',
sprintf(
'To revert the migration you can use <info>migrations:execute --down \'%s\'</info>',
'To revert the migration you can use <info>migrations:execute --down "%s"</info>',
addslashes($fqcn),
),
'',
Expand Down
4 changes: 2 additions & 2 deletions tests/Tools/Console/Command/DiffCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public function testExecute(): void
self::assertSame([
'Generated new migration class to "/path/to/migration.php"',
'',
'To run just this migration for testing purposes, you can use migrations:execute --up \'FooNs\\\\Version1234\'',
'To run just this migration for testing purposes, you can use migrations:execute --up "FooNs\\\\Version1234"',
'',
'To revert the migration you can use migrations:execute --down \'FooNs\\\\Version1234\'',
'To revert the migration you can use migrations:execute --down "FooNs\\\\Version1234"',
], array_map(trim(...), explode("\n", trim($output))));
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Tools/Console/Command/DumpSchemaCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public function testExecute(): void
[
'Dumped your schema to a new migration class at ""',
'',
'To run just this migration for testing purposes, you can use migrations:execute --up \'FooNs\\\\Version1234\'',
'To run just this migration for testing purposes, you can use migrations:execute --up "FooNs\\\\Version1234"',
'',
'To revert the migration you can use migrations:execute --down \'FooNs\\\\Version1234\'',
'To revert the migration you can use migrations:execute --down "FooNs\\\\Version1234"',
'',
'To use this as a rollup migration you can use the migrations:rollup command.',
],
Expand Down

0 comments on commit 3856beb

Please sign in to comment.