Skip to content

Commit

Permalink
removed support for PHP 7
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 10, 2021
1 parent 9478642 commit 806122a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
31 changes: 13 additions & 18 deletions src/Dibi/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,24 +216,19 @@ public function toDataSource(): self
*/
public function __toString(): string
{
try {
return $this->connection->translate(
"\nSELECT %n",
(empty($this->cols) ? '*' : $this->cols),
"\nFROM %SQL",
$this->sql,
"\n%ex",
$this->conds ? ['WHERE %and', $this->conds] : null,
"\n%ex",
$this->sorting ? ['ORDER BY %by', $this->sorting] : null,
"\n%ofs %lmt",
$this->offset,
$this->limit,
);
} catch (\Throwable $e) {
trigger_error($e->getMessage(), E_USER_ERROR);
return '';
}
return $this->connection->translate(
"\nSELECT %n",
(empty($this->cols) ? '*' : $this->cols),
"\nFROM %SQL",
$this->sql,
"\n%ex",
$this->conds ? ['WHERE %and', $this->conds] : null,
"\n%ex",
$this->sorting ? ['ORDER BY %by', $this->sorting] : null,
"\n%ofs %lmt",
$this->offset,
$this->limit,
);
}


Expand Down
7 changes: 1 addition & 6 deletions src/Dibi/Fluent.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,7 @@ public function toDataSource(): DataSource
*/
final public function __toString(): string
{
try {
return $this->connection->translate($this->_export());
} catch (\Throwable $e) {
trigger_error($e->getMessage(), E_USER_ERROR);
return '';
}
return $this->connection->translate($this->_export());
}


Expand Down

0 comments on commit 806122a

Please sign in to comment.