Skip to content

Commit 0551c5e

Browse files
committed
Fixed code style
1 parent c41e7ce commit 0551c5e

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

lib/Doctrine/DBAL/Cache/ArrayStatement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function getIterator()
100100
*/
101101
public function fetch($fetchMode = null, $cursorOrientation = \PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
102102
{
103-
if ( ! isset($this->data[$this->num])) {
103+
if (! isset($this->data[$this->num])) {
104104
return false;
105105
}
106106

lib/Doctrine/DBAL/Cache/ResultCacheStatement.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,19 @@ public function fetch($fetchMode = null, $cursorOrientation = \PDO::FETCH_ORI_NE
160160

161161
$fetchMode = $fetchMode ?: $this->defaultFetchMode;
162162

163-
if ($fetchMode == FetchMode::ASSOCIATIVE) {
163+
if ($fetchMode === FetchMode::ASSOCIATIVE) {
164164
return $row;
165165
}
166166

167-
if ($fetchMode == FetchMode::NUMERIC) {
167+
if ($fetchMode === FetchMode::NUMERIC) {
168168
return array_values($row);
169169
}
170170

171-
if ($fetchMode == FetchMode::MIXED) {
171+
if ($fetchMode === FetchMode::MIXED) {
172172
return array_merge($row, array_values($row));
173173
}
174174

175-
if ($fetchMode == FetchMode::COLUMN) {
175+
if ($fetchMode === FetchMode::COLUMN) {
176176
return reset($row);
177177
}
178178

lib/Doctrine/DBAL/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ class Connection implements DriverConnection
7474
*
7575
* @var integer
7676
*/
77-
const PARAM_INT_ARRAY = ParameterType::INTEGER + self::ARRAY_PARAM_OFFSET;
77+
public const PARAM_INT_ARRAY = ParameterType::INTEGER + self::ARRAY_PARAM_OFFSET;
7878

7979
/**
8080
* Represents an array of strings to be expanded by Doctrine SQL parsing.
8181
*
8282
* @var integer
8383
*/
84-
const PARAM_STR_ARRAY = ParameterType::STRING + self::ARRAY_PARAM_OFFSET;
84+
public const PARAM_STR_ARRAY = ParameterType::STRING + self::ARRAY_PARAM_OFFSET;
8585

8686
/**
8787
* Offset by which PARAM_* constants are detected as arrays of the param type.

lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function quote($input, $type = ParameterType::STRING)
103103
{
104104
$input = db2_escape_string($input);
105105

106-
if ($type == ParameterType::INTEGER) {
106+
if ($type === ParameterType::INTEGER) {
107107
return $input;
108108
}
109109

lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class DB2Statement implements \IteratorAggregate, Statement
6565
*/
6666
static private $_typeMap = [
6767
ParameterType::INTEGER => DB2_LONG,
68-
ParameterType::STRING => DB2_CHAR,
68+
ParameterType::STRING => DB2_CHAR,
6969
];
7070

7171
/**

lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ class MysqliStatement implements \IteratorAggregate, Statement
3333
* @var array
3434
*/
3535
protected static $_paramTypeMap = [
36-
ParameterType::STRING => 's',
37-
ParameterType::BOOLEAN => 'i',
38-
ParameterType::NULL => 's',
39-
ParameterType::INTEGER => 'i',
40-
ParameterType::LARGE_OBJECT => 's' // TODO Support LOB bigger then max package size.
36+
ParameterType::STRING => 's',
37+
ParameterType::BOOLEAN => 'i',
38+
ParameterType::NULL => 's',
39+
ParameterType::INTEGER => 'i',
40+
41+
// TODO Support LOB bigger then max package size
42+
ParameterType::LARGE_OBJECT => 's',
4143
];
4244

4345
/**

lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ class OCI8Statement implements IteratorAggregate, Statement
5757
* @var array
5858
*/
5959
protected static $fetchModeMap = [
60-
FetchMode::MIXED => OCI_BOTH,
60+
FetchMode::MIXED => OCI_BOTH,
6161
FetchMode::ASSOCIATIVE => OCI_ASSOC,
62-
FetchMode::NUMERIC => OCI_NUM,
63-
FetchMode::COLUMN => OCI_NUM,
62+
FetchMode::NUMERIC => OCI_NUM,
63+
FetchMode::COLUMN => OCI_NUM,
6464
];
6565

6666
/**
@@ -267,7 +267,7 @@ public function bindParam($column, &$variable, $type = ParameterType::STRING, $l
267267
{
268268
$column = $this->_paramMap[$column] ?? $column;
269269

270-
if ($type == ParameterType::LARGE_OBJECT) {
270+
if ($type === ParameterType::LARGE_OBJECT) {
271271
$lob = oci_new_descriptor($this->_dbh, OCI_D_LOB);
272272
$lob->writeTemporary($variable, OCI_TEMP_BLOB);
273273

@@ -415,7 +415,7 @@ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = n
415415

416416
$result = [];
417417

418-
if ($fetchMode == FetchMode::STANDARD_OBJECT) {
418+
if ($fetchMode === FetchMode::STANDARD_OBJECT) {
419419
while ($row = $this->fetch($fetchMode)) {
420420
$result[] = $row;
421421
}
@@ -434,7 +434,7 @@ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = n
434434
} else {
435435
$fetchStructure = OCI_FETCHSTATEMENT_BY_ROW;
436436

437-
if ($fetchMode == FetchMode::COLUMN) {
437+
if ($fetchMode === FetchMode::COLUMN) {
438438
$fetchStructure = OCI_FETCHSTATEMENT_BY_COLUMN;
439439
}
440440

@@ -447,7 +447,7 @@ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = n
447447
oci_fetch_all($this->_sth, $result, 0, -1,
448448
self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS);
449449

450-
if ($fetchMode == FetchMode::COLUMN) {
450+
if ($fetchMode === FetchMode::COLUMN) {
451451
$result = $result[0];
452452
}
453453
}

lib/Doctrine/DBAL/Driver/PDOStatement.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,10 @@ public function fetchColumn($columnIndex = 0)
209209
* Converts DBAL parameter type to PDO parameter type
210210
*
211211
* @param int $type Parameter type
212-
* @return int
213212
*/
214213
private function convertParamType(int $type) : int
215214
{
216-
if ( ! isset(self::PARAM_TYPE_MAP[$type])) {
215+
if (! isset(self::PARAM_TYPE_MAP[$type])) {
217216
throw new \InvalidArgumentException('Invalid parameter type: ' . $type);
218217
}
219218

@@ -224,15 +223,14 @@ private function convertParamType(int $type) : int
224223
* Converts DBAL fetch mode to PDO fetch mode
225224
*
226225
* @param int|null $fetchMode Fetch mode
227-
* @return int|null
228226
*/
229227
private function convertFetchMode(?int $fetchMode) : ?int
230228
{
231229
if ($fetchMode === null) {
232230
return null;
233231
}
234232

235-
if ( ! isset(self::FETCH_MODE_MAP[$fetchMode])) {
233+
if (! isset(self::FETCH_MODE_MAP[$fetchMode])) {
236234
throw new \InvalidArgumentException('Invalid fetch mode: ' . $fetchMode);
237235
}
238236

lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ class SQLSrvStatement implements IteratorAggregate, Statement
7474
* @var array
7575
*/
7676
private static $fetchMap = [
77-
FetchMode::MIXED => SQLSRV_FETCH_BOTH,
77+
FetchMode::MIXED => SQLSRV_FETCH_BOTH,
7878
FetchMode::ASSOCIATIVE => SQLSRV_FETCH_ASSOC,
79-
FetchMode::NUMERIC => SQLSRV_FETCH_NUMERIC,
79+
FetchMode::NUMERIC => SQLSRV_FETCH_NUMERIC,
8080
];
8181

8282
/**

tests/Doctrine/Tests/DBAL/DriverManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function testDatabaseUrl($url, $expected)
139139
);
140140

141141
if (isset($options['pdo'])) {
142-
if ( ! extension_loaded('pdo')) {
142+
if (! extension_loaded('pdo')) {
143143
$this->markTestSkipped('PDO is not installed');
144144
}
145145

tests/Doctrine/Tests/TestUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private static function getSpecifiedConnectionParams() {
113113

114114
private static function getFallbackConnectionParams()
115115
{
116-
if ( ! extension_loaded('pdo_sqlite')) {
116+
if (! extension_loaded('pdo_sqlite')) {
117117
Assert::markTestSkipped('PDO SQLite extension is not loaded');
118118
}
119119

0 commit comments

Comments
 (0)