Skip to content

Commit

Permalink
remove unused imports, better conditionals
Browse files Browse the repository at this point in the history
Signed-off-by: pine3ree <[email protected]>
  • Loading branch information
pine3ree committed Oct 18, 2023
1 parent f299eda commit a2e52ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Sql/Statement/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace pine3ree\Db\Sql\Statement;

use pine3ree\Db\Sql;
use pine3ree\Db\Sql\Clause\WhereAwareTrait;
use pine3ree\Db\Sql\Clause\Where;
use pine3ree\Db\Sql\Driver;
Expand Down Expand Up @@ -97,7 +96,7 @@ public function __get(string $name)
}

if ('where' === $name) {
if (!isset($this->where)) {
if ($this->where === null) {
$this->where = new Where();
$this->where->setParent($this);
}
Expand All @@ -110,7 +109,7 @@ public function __get(string $name)
public function __clone()
{
parent::__clone();
if (isset($this->where)) {
if ($this->where instanceof Where) {
$this->where = clone $this->where;
$this->where->setParent($this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sql/Statement/Insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public function __get(string $name)
public function __clone()
{
parent::__clone();
if (isset($this->select)) {
if ($this->select instanceof Select) {
$this->select = clone $this->select;
$this->select->setParent($this);
}
Expand Down

0 comments on commit a2e52ad

Please sign in to comment.