Skip to content

Commit

Permalink
fix method extends error
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Sep 13, 2020
1 parent 29977fa commit 2f1552f
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/db/src/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function compileCreate(Blueprint $blueprint, Fluent $command, Connection
*
* @return string
*/
protected function compileCreateTable(Blueprint $blueprint, $command, $connection)
protected function compileCreateTable(Blueprint $blueprint, $command, $connection): string
{
$ifNotExist = '';
if ($command['ifNotExists']) {
Expand Down Expand Up @@ -211,7 +211,9 @@ protected function compileCreateEngine($sql, Connection $connection, Blueprint $
{
if (isset($blueprint->engine)) {
return $sql . ' engine = ' . $blueprint->engine;
} elseif ($engine = $connection->getDatabase()->getConfig()['engine'] ?? 'InnoDB') {
}

if ($engine = $connection->getDatabase()->getConfig()['engine'] ?? 'InnoDB') {
return $sql . ' engine = ' . $engine;
}

Expand Down Expand Up @@ -877,7 +879,7 @@ protected function typeTimestampTz(Fluent $column)
*
* @return string
*/
protected function typeYear(Fluent $column)
protected function typeYear(Fluent $column): string
{
return 'year';
}
Expand All @@ -889,7 +891,7 @@ protected function typeYear(Fluent $column)
*
* @return string
*/
protected function typeBinary(Fluent $column)
protected function typeBinary(Fluent $column): string
{
return 'blob';
}
Expand All @@ -901,7 +903,7 @@ protected function typeBinary(Fluent $column)
*
* @return string
*/
protected function typeUuid(Fluent $column)
protected function typeUuid(Fluent $column): string
{
return 'char(36)';
}
Expand All @@ -913,7 +915,7 @@ protected function typeUuid(Fluent $column)
*
* @return string
*/
protected function typeIpAddress(Fluent $column)
protected function typeIpAddress(Fluent $column): string
{
return 'varchar(45)';
}
Expand All @@ -925,7 +927,7 @@ protected function typeIpAddress(Fluent $column)
*
* @return string
*/
protected function typeMacAddress(Fluent $column)
protected function typeMacAddress(Fluent $column): string
{
return 'varchar(17)';
}
Expand All @@ -937,7 +939,7 @@ protected function typeMacAddress(Fluent $column)
*
* @return string
*/
public function typeGeometry(Fluent $column)
public function typeGeometry(Fluent $column): string
{
return 'geometry';
}
Expand All @@ -949,7 +951,7 @@ public function typeGeometry(Fluent $column)
*
* @return string
*/
public function typePoint(Fluent $column)
public function typePoint(Fluent $column): string
{
return 'point';
}
Expand All @@ -961,7 +963,7 @@ public function typePoint(Fluent $column)
*
* @return string
*/
public function typeLineString(Fluent $column)
public function typeLineString(Fluent $column): string
{
return 'linestring';
}
Expand All @@ -973,7 +975,7 @@ public function typeLineString(Fluent $column)
*
* @return string
*/
public function typePolygon(Fluent $column)
public function typePolygon(Fluent $column): string
{
return 'polygon';
}
Expand All @@ -985,7 +987,7 @@ public function typePolygon(Fluent $column)
*
* @return string
*/
public function typeGeometryCollection(Fluent $column)
public function typeGeometryCollection(Fluent $column): string
{
return 'geometrycollection';
}
Expand All @@ -997,7 +999,7 @@ public function typeGeometryCollection(Fluent $column)
*
* @return string
*/
public function typeMultiPoint(Fluent $column)
public function typeMultiPoint(Fluent $column): string
{
return 'multipoint';
}
Expand All @@ -1009,7 +1011,7 @@ public function typeMultiPoint(Fluent $column)
*
* @return string
*/
public function typeMultiLineString(Fluent $column)
public function typeMultiLineString(Fluent $column): string
{
return 'multilinestring';
}
Expand All @@ -1021,7 +1023,7 @@ public function typeMultiLineString(Fluent $column)
*
* @return string
*/
public function typeMultiPolygon(Fluent $column)
public function typeMultiPolygon(Fluent $column): string
{
return 'multipolygon';
}
Expand Down Expand Up @@ -1243,7 +1245,7 @@ protected function modifySrid(Blueprint $blueprint, Fluent $column)
*
* @return string
*/
protected function wrapValue($value)
protected function wrapValue($value): string
{
if ($value !== '*') {
return '`' . str_replace('`', '``', $value) . '`';
Expand Down

0 comments on commit 2f1552f

Please sign in to comment.