Skip to content

Commit

Permalink
fix consolidate Grammar::wrapValue
Browse files Browse the repository at this point in the history
  • Loading branch information
taka-oyama committed Aug 17, 2022
1 parent 43bffe6 commit ca8faa1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
13 changes: 13 additions & 0 deletions src/Colopl/Spanner/Concerns/SharedGrammarCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,17 @@ public function getDateFormat()
{
return 'Y-m-d\TH:i:s.uP';
}

/**
* @inheritDoc
*/
protected function wrapValue($value)
{
if ($value === '*') {
return $value;
}

return '`'.str_replace('`', '``', $value).'`';
}

}
12 changes: 0 additions & 12 deletions src/Colopl/Spanner/Query/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,6 @@ protected function whereInUnnest(Builder $query, $where)
: '0 = 1';
}

/**
* @inheritDoc
*/
protected function wrapValue($value)
{
if ($value === '*') {
return $value;
}

return '`'.str_replace('`', '``', $value).'`';
}

/**
* @inheritDoc
*/
Expand Down
12 changes: 0 additions & 12 deletions src/Colopl/Spanner/Schema/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,18 +433,6 @@ protected function modifyNullable(Blueprint $blueprint, Fluent $column)
return null;
}

/**
* @inheritDoc
*/
protected function wrapValue($value)
{
if ($value === '*') {
return $value;
}

return '`'.str_replace('`', '``', $value).'`';
}

/**
* Compile the blueprint's column definitions.
*
Expand Down

0 comments on commit ca8faa1

Please sign in to comment.