1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-11 08:34:59 +02:00

improved coding style

This commit is contained in:
David Grudl
2015-06-19 03:11:36 +02:00
parent 462ef6934b
commit ca99b0b822
55 changed files with 297 additions and 306 deletions

View File

@@ -160,7 +160,7 @@ final class DibiTranslator extends DibiObject
if ($comment) {
$sql[] = "*/";
$sql[] = '*/';
}
$sql = implode(' ', $sql);
@@ -187,7 +187,7 @@ final class DibiTranslator extends DibiObject
public function formatValue($value, $modifier)
{
if ($this->comment) {
return "...";
return '...';
}
if (!$this->driver) {
@@ -494,7 +494,7 @@ final class DibiTranslator extends DibiObject
if ($cursor >= count($this->args)) {
$this->hasError = TRUE;
return "**Extra placeholder**";
return '**Extra placeholder**';
}
$cursor++;
@@ -517,7 +517,7 @@ final class DibiTranslator extends DibiObject
// open comment
$this->ifLevelStart = $this->ifLevel;
$this->comment = TRUE;
return "/*";
return '/*';
}
return '';
@@ -525,11 +525,11 @@ final class DibiTranslator extends DibiObject
if ($this->ifLevelStart === $this->ifLevel) {
$this->ifLevelStart = 0;
$this->comment = FALSE;
return "*/";
return '*/';
} elseif (!$this->comment) {
$this->ifLevelStart = $this->ifLevel;
$this->comment = TRUE;
return "/*";
return '/*';
}
} elseif ($mod === 'end') {
@@ -538,7 +538,7 @@ final class DibiTranslator extends DibiObject
// close comment
$this->ifLevelStart = 0;
$this->comment = FALSE;
return "*/";
return '*/';
}
return '';
@@ -583,10 +583,10 @@ final class DibiTranslator extends DibiObject
return $this->identifiers->{$matches[2]};
} elseif ($matches[3]) { // SQL strings: '...'
return $this->driver->escape( str_replace("''", "'", $matches[4]), dibi::TEXT);
return $this->driver->escape(str_replace("''", "'", $matches[4]), dibi::TEXT);
} elseif ($matches[5]) { // SQL strings: "..."
return $this->driver->escape( str_replace('""', '"', $matches[6]), dibi::TEXT);
return $this->driver->escape(str_replace('""', '"', $matches[6]), dibi::TEXT);
} elseif ($matches[7]) { // string quote
$this->hasError = TRUE;