Skip to content

Commit 9a3d71d

Browse files
committed
formatting
1 parent bba3eae commit 9a3d71d

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/Illuminate/Database/Grammar.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -138,29 +138,29 @@ public function parameterize(array $values)
138138
}
139139

140140
/**
141-
* Quote string literals.
141+
* Get the appropriate query parameter place-holder for a value.
142142
*
143-
* @param string|array $value
143+
* @param mixed $value
144144
* @return string
145145
*/
146-
public function quote($value)
146+
public function parameter($value)
147147
{
148-
if (is_array($value)) {
149-
return implode(', ', array_map([$this, 'quote'], $value));
150-
}
151-
152-
return "'$value'";
148+
return $this->isExpression($value) ? $this->getValue($value) : '?';
153149
}
154150

155151
/**
156-
* Get the appropriate query parameter place-holder for a value.
152+
* Quote the given string literal.
157153
*
158-
* @param mixed $value
154+
* @param string|array $value
159155
* @return string
160156
*/
161-
public function parameter($value)
157+
public function quoteString($value)
162158
{
163-
return $this->isExpression($value) ? $this->getValue($value) : '?';
159+
if (is_array($value)) {
160+
return implode(', ', array_map([$this, __FUNCTION__], $value));
161+
}
162+
163+
return "'$value'";
164164
}
165165

166166
/**

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ protected function typeBoolean(Fluent $column)
549549
*/
550550
protected function typeEnum(Fluent $column)
551551
{
552-
return sprintf('enum(%s)', $this->quote($column->allowed));
552+
return sprintf('enum(%s)', $this->quoteString($column->allowed));
553553
}
554554

555555
/**

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ protected function typeEnum(Fluent $column)
522522
return sprintf(
523523
'varchar(255) check ("%s" in (%s))',
524524
$column->name,
525-
$this->quote($column->allowed)
525+
$this->quoteString($column->allowed)
526526
);
527527
}
528528

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ protected function typeEnum(Fluent $column)
512512
return sprintf(
513513
'varchar check ("%s" in (%s))',
514514
$column->name,
515-
$this->quote($column->allowed)
515+
$this->quoteString($column->allowed)
516516
);
517517
}
518518

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ protected function typeEnum(Fluent $column)
455455
return sprintf(
456456
'nvarchar(255) check ("%s" in (%s))',
457457
$column->name,
458-
$this->quote($column->allowed)
458+
$this->quoteString($column->allowed)
459459
);
460460
}
461461

0 commit comments

Comments
 (0)