Skip to content
This repository was archived by the owner on Nov 26, 2022. It is now read-only.

Commit db4f25c

Browse files
committed
Fix cs
1 parent 3078f45 commit db4f25c

9 files changed

Lines changed: 11 additions & 32 deletions

src/Condition.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ public function getConditionSql(array $sql, array $where, string $conditionType)
111111
*/
112112
private function getRightFieldValue($rightField, $comparison): array
113113
{
114-
if ($comparison == 'in' || $comparison == 'not in') {
114+
if ($comparison === 'in' || $comparison === 'not in') {
115115
$rightField = '(' . implode(', ', $this->quoter->quoteArray((array)$rightField)) . ')';
116-
} elseif ($comparison == 'greatest' ||
117-
$comparison == 'least' ||
118-
$comparison == 'coalesce' ||
119-
$comparison == 'interval' ||
116+
} elseif ($comparison === 'greatest' ||
117+
$comparison === 'least' ||
118+
$comparison === 'coalesce' ||
119+
$comparison === 'interval' ||
120120
$comparison === 'strcmp') {
121121
$comparison = '= ' . $comparison;
122122
$rightField = '(' . implode(', ', $this->quoter->quoteArray((array)$rightField)) . ')';

src/DeleteQuery.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,8 @@ public function build(): string
243243
$sql = $this->condition->getWhereSql($sql);
244244
$sql = $this->getOrderBySql($sql);
245245
$sql = $this->getLimitSql($sql);
246-
$result = trim(implode(' ', $sql)) . ';';
247246

248-
return $result;
247+
return trim(implode(' ', $sql)) . ';';
249248
}
250249

251250
/**
@@ -311,7 +310,7 @@ private function getLimitSql(array $sql): array
311310
if (!isset($this->limit)) {
312311
return $sql;
313312
}
314-
$sql[] = sprintf('LIMIT %s', (int)$this->limit);
313+
$sql[] = sprintf('LIMIT %s', $this->limit);
315314

316315
return $sql;
317316
}

src/Quoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private function quoteNameWithSeparator(string $spec, string $sep, int $pos): st
152152
public function quoteIdentifier(string $name): string
153153
{
154154
$name = trim($name);
155-
if ($name == '*') {
155+
if ($name === '*') {
156156
return $name;
157157
}
158158

src/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function setDatabase(string $dbName): bool
5151
*/
5252
public function getDatabase(): string
5353
{
54-
return $this->pdo->query('SELECT database() AS dbname;')->fetchColumn(0);
54+
return $this->pdo->query('SELECT database() AS dbname;')->fetchColumn();
5555
}
5656

5757
/**

src/SelectQueryBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Odan\Database;
44

55
use Closure;
6-
use PDO;
76

87
/**
98
* Select Query.

src/UpdateQuery.php

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ final class UpdateQuery implements QueryInterface
3232
*/
3333
private $values;
3434

35-
/**
36-
* @var array Assignment list
37-
*/
38-
private $duplicateValues;
39-
4035
/**
4136
* @var string Priority modifier
4237
*/
@@ -64,16 +59,6 @@ final class UpdateQuery implements QueryInterface
6459
*/
6560
private $limit;
6661

67-
/**
68-
* @var array Increment
69-
*/
70-
private $increment = [];
71-
72-
/**
73-
* @var array Decrement
74-
*/
75-
private $decrement = [];
76-
7762
/**
7863
* Constructor.
7964
*
@@ -261,9 +246,8 @@ public function build(): string
261246
$sql = $this->condition->getWhereSql($sql);
262247
$sql = $this->getOrderBySql($sql);
263248
$sql = $this->getLimitSql($sql);
264-
$result = trim(implode(' ', $sql)) . ';';
265249

266-
return $result;
250+
return trim(implode(' ', $sql)) . ';';
267251
}
268252

269253
/**
@@ -331,7 +315,7 @@ private function getLimitSql(array $sql): array
331315
if (!isset($this->limit)) {
332316
return $sql;
333317
}
334-
$sql[] = sprintf('LIMIT %s', (int)$this->limit);
318+
$sql[] = sprintf('LIMIT %s', $this->limit);
335319

336320
return $sql;
337321
}

tests/ConnectionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Odan\Database\Connection;
88
use PDO;
9-
use PDOStatement;
109

1110
/**
1211
* @coversDefaultClass \Odan\Database\Connection

tests/DeleteQueryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Odan\Database\Test;
44

55
use Odan\Database\DeleteQuery;
6-
use PDOStatement;
76

87
/**
98
* @coversDefaultClass \Odan\Database\DeleteQuery

tests/QuoterTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Odan\Database\Quoter;
88
use Odan\Database\RawExp;
9-
use PDO;
109

1110
/**
1211
* @coversDefaultClass \Odan\Database\Quoter

0 commit comments

Comments
 (0)