Skip to content

Commit 3a8a839

Browse files
[12.x] Improve queries readablility (#54791)
* improve queries readability * fix tests
1 parent 6782c1b commit 3a8a839

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ public function compileRenameIndex(Blueprint $blueprint, Fluent $command)
653653
*/
654654
public function compileDropAllTables($tables)
655655
{
656-
return 'drop table '.implode(',', $this->wrapArray($tables));
656+
return 'drop table '.implode(', ', $this->wrapArray($tables));
657657
}
658658

659659
/**
@@ -664,7 +664,7 @@ public function compileDropAllTables($tables)
664664
*/
665665
public function compileDropAllViews($views)
666666
{
667-
return 'drop view '.implode(',', $this->wrapArray($views));
667+
return 'drop view '.implode(', ', $this->wrapArray($views));
668668
}
669669

670670
/**

src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public function compileDropIfExists(Blueprint $blueprint, Fluent $command)
463463
*/
464464
public function compileDropAllTables($tables)
465465
{
466-
return 'drop table '.implode(',', $this->escapeNames($tables)).' cascade';
466+
return 'drop table '.implode(', ', $this->escapeNames($tables)).' cascade';
467467
}
468468

469469
/**
@@ -474,7 +474,7 @@ public function compileDropAllTables($tables)
474474
*/
475475
public function compileDropAllViews($views)
476476
{
477-
return 'drop view '.implode(',', $this->escapeNames($views)).' cascade';
477+
return 'drop view '.implode(', ', $this->escapeNames($views)).' cascade';
478478
}
479479

480480
/**
@@ -485,7 +485,7 @@ public function compileDropAllViews($views)
485485
*/
486486
public function compileDropAllTypes($types)
487487
{
488-
return 'drop type '.implode(',', $this->escapeNames($types)).' cascade';
488+
return 'drop type '.implode(', ', $this->escapeNames($types)).' cascade';
489489
}
490490

491491
/**
@@ -496,7 +496,7 @@ public function compileDropAllTypes($types)
496496
*/
497497
public function compileDropAllDomains($domains)
498498
{
499-
return 'drop domain '.implode(',', $this->escapeNames($domains)).' cascade';
499+
return 'drop domain '.implode(', ', $this->escapeNames($domains)).' cascade';
500500
}
501501

502502
/**

src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ public function compileDropDefaultConstraint(Blueprint $blueprint, Fluent $comma
405405
{
406406
$columns = $command->name === 'change'
407407
? "'".$command->column->name."'"
408-
: "'".implode("','", $command->columns)."'";
408+
: "'".implode("', '", $command->columns)."'";
409409

410410
$table = $this->wrapTable($blueprint);
411411
$tableName = $this->quoteString($this->wrapTable($blueprint));

tests/Database/DatabaseMariaDbSchemaGrammarTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,14 +1471,14 @@ public function testDropAllTables()
14711471
$connection = $this->getConnection();
14721472
$statement = $this->getGrammar($connection)->compileDropAllTables(['alpha', 'beta', 'gamma']);
14731473

1474-
$this->assertSame('drop table `alpha`,`beta`,`gamma`', $statement);
1474+
$this->assertSame('drop table `alpha`, `beta`, `gamma`', $statement);
14751475
}
14761476

14771477
public function testDropAllViews()
14781478
{
14791479
$statement = $this->getGrammar()->compileDropAllViews(['alpha', 'beta', 'gamma']);
14801480

1481-
$this->assertSame('drop view `alpha`,`beta`,`gamma`', $statement);
1481+
$this->assertSame('drop view `alpha`, `beta`, `gamma`', $statement);
14821482
}
14831483

14841484
public function testGrammarsAreMacroable()

tests/Database/DatabaseMySqlSchemaGrammarTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,14 +1480,14 @@ public function testDropAllTables()
14801480
{
14811481
$statement = $this->getGrammar()->compileDropAllTables(['alpha', 'beta', 'gamma']);
14821482

1483-
$this->assertSame('drop table `alpha`,`beta`,`gamma`', $statement);
1483+
$this->assertSame('drop table `alpha`, `beta`, `gamma`', $statement);
14841484
}
14851485

14861486
public function testDropAllViews()
14871487
{
14881488
$statement = $this->getGrammar()->compileDropAllViews(['alpha', 'beta', 'gamma']);
14891489

1490-
$this->assertSame('drop view `alpha`,`beta`,`gamma`', $statement);
1490+
$this->assertSame('drop view `alpha`, `beta`, `gamma`', $statement);
14911491
}
14921492

14931493
public function testGrammarsAreMacroable()

tests/Database/DatabasePostgresSchemaGrammarTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,21 +1093,21 @@ public function testDropAllTablesEscapesTableNames()
10931093
{
10941094
$statement = $this->getGrammar()->compileDropAllTables(['alpha', 'beta', 'gamma']);
10951095

1096-
$this->assertSame('drop table "alpha","beta","gamma" cascade', $statement);
1096+
$this->assertSame('drop table "alpha", "beta", "gamma" cascade', $statement);
10971097
}
10981098

10991099
public function testDropAllViewsEscapesTableNames()
11001100
{
11011101
$statement = $this->getGrammar()->compileDropAllViews(['alpha', 'beta', 'gamma']);
11021102

1103-
$this->assertSame('drop view "alpha","beta","gamma" cascade', $statement);
1103+
$this->assertSame('drop view "alpha", "beta", "gamma" cascade', $statement);
11041104
}
11051105

11061106
public function testDropAllTypesEscapesTableNames()
11071107
{
11081108
$statement = $this->getGrammar()->compileDropAllTypes(['alpha', 'beta', 'gamma']);
11091109

1110-
$this->assertSame('drop type "alpha","beta","gamma" cascade', $statement);
1110+
$this->assertSame('drop type "alpha", "beta", "gamma" cascade', $statement);
11111111
}
11121112

11131113
public function testCompileColumns()

0 commit comments

Comments
 (0)