Fixed code style

parent 7dadba43
...@@ -100,7 +100,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement ...@@ -100,7 +100,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
*/ */
public function fetch($fetchMode = null, $cursorOrientation = \PDO::FETCH_ORI_NEXT, $cursorOffset = 0) public function fetch($fetchMode = null, $cursorOrientation = \PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
{ {
if ( ! isset($this->data[$this->num])) { if (! isset($this->data[$this->num])) {
return false; return false;
} }
......
...@@ -160,19 +160,19 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement ...@@ -160,19 +160,19 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
$fetchMode = $fetchMode ?: $this->defaultFetchMode; $fetchMode = $fetchMode ?: $this->defaultFetchMode;
if ($fetchMode == FetchMode::ASSOCIATIVE) { if ($fetchMode === FetchMode::ASSOCIATIVE) {
return $row; return $row;
} }
if ($fetchMode == FetchMode::NUMERIC) { if ($fetchMode === FetchMode::NUMERIC) {
return array_values($row); return array_values($row);
} }
if ($fetchMode == FetchMode::MIXED) { if ($fetchMode === FetchMode::MIXED) {
return array_merge($row, array_values($row)); return array_merge($row, array_values($row));
} }
if ($fetchMode == FetchMode::COLUMN) { if ($fetchMode === FetchMode::COLUMN) {
return reset($row); return reset($row);
} }
......
...@@ -82,14 +82,14 @@ class Connection implements DriverConnection ...@@ -82,14 +82,14 @@ class Connection implements DriverConnection
* *
* @var int * @var int
*/ */
const PARAM_INT_ARRAY = ParameterType::INTEGER + self::ARRAY_PARAM_OFFSET; public const PARAM_INT_ARRAY = ParameterType::INTEGER + self::ARRAY_PARAM_OFFSET;
/** /**
* Represents an array of strings to be expanded by Doctrine SQL parsing. * Represents an array of strings to be expanded by Doctrine SQL parsing.
* *
* @var int * @var int
*/ */
const PARAM_STR_ARRAY = ParameterType::STRING + self::ARRAY_PARAM_OFFSET; public const PARAM_STR_ARRAY = ParameterType::STRING + self::ARRAY_PARAM_OFFSET;
/** /**
* Offset by which PARAM_* constants are detected as arrays of the param type. * Offset by which PARAM_* constants are detected as arrays of the param type.
......
...@@ -103,7 +103,7 @@ class DB2Connection implements Connection, ServerInfoAwareConnection ...@@ -103,7 +103,7 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
{ {
$input = db2_escape_string($input); $input = db2_escape_string($input);
if ($type == ParameterType::INTEGER) { if ($type === ParameterType::INTEGER) {
return $input; return $input;
} }
......
...@@ -37,7 +37,9 @@ class MysqliStatement implements \IteratorAggregate, Statement ...@@ -37,7 +37,9 @@ class MysqliStatement implements \IteratorAggregate, Statement
ParameterType::BOOLEAN => 'i', ParameterType::BOOLEAN => 'i',
ParameterType::NULL => 's', ParameterType::NULL => 's',
ParameterType::INTEGER => 'i', ParameterType::INTEGER => 'i',
ParameterType::LARGE_OBJECT => 's' // TODO Support LOB bigger then max package size.
// TODO Support LOB bigger then max package size
ParameterType::LARGE_OBJECT => 's',
]; ];
/** /**
......
...@@ -267,7 +267,7 @@ class OCI8Statement implements IteratorAggregate, Statement ...@@ -267,7 +267,7 @@ class OCI8Statement implements IteratorAggregate, Statement
{ {
$column = $this->_paramMap[$column] ?? $column; $column = $this->_paramMap[$column] ?? $column;
if ($type == ParameterType::LARGE_OBJECT) { if ($type === ParameterType::LARGE_OBJECT) {
$lob = oci_new_descriptor($this->_dbh, OCI_D_LOB); $lob = oci_new_descriptor($this->_dbh, OCI_D_LOB);
$lob->writeTemporary($variable, OCI_TEMP_BLOB); $lob->writeTemporary($variable, OCI_TEMP_BLOB);
...@@ -415,7 +415,7 @@ class OCI8Statement implements IteratorAggregate, Statement ...@@ -415,7 +415,7 @@ class OCI8Statement implements IteratorAggregate, Statement
$result = []; $result = [];
if ($fetchMode == FetchMode::STANDARD_OBJECT) { if ($fetchMode === FetchMode::STANDARD_OBJECT) {
while ($row = $this->fetch($fetchMode)) { while ($row = $this->fetch($fetchMode)) {
$result[] = $row; $result[] = $row;
} }
...@@ -434,7 +434,7 @@ class OCI8Statement implements IteratorAggregate, Statement ...@@ -434,7 +434,7 @@ class OCI8Statement implements IteratorAggregate, Statement
} else { } else {
$fetchStructure = OCI_FETCHSTATEMENT_BY_ROW; $fetchStructure = OCI_FETCHSTATEMENT_BY_ROW;
if ($fetchMode == FetchMode::COLUMN) { if ($fetchMode === FetchMode::COLUMN) {
$fetchStructure = OCI_FETCHSTATEMENT_BY_COLUMN; $fetchStructure = OCI_FETCHSTATEMENT_BY_COLUMN;
} }
...@@ -447,7 +447,7 @@ class OCI8Statement implements IteratorAggregate, Statement ...@@ -447,7 +447,7 @@ class OCI8Statement implements IteratorAggregate, Statement
oci_fetch_all($this->_sth, $result, 0, -1, oci_fetch_all($this->_sth, $result, 0, -1,
self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS); self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS);
if ($fetchMode == FetchMode::COLUMN) { if ($fetchMode === FetchMode::COLUMN) {
$result = $result[0]; $result = $result[0];
} }
} }
......
...@@ -209,11 +209,10 @@ class PDOStatement extends \PDOStatement implements Statement ...@@ -209,11 +209,10 @@ class PDOStatement extends \PDOStatement implements Statement
* Converts DBAL parameter type to PDO parameter type * Converts DBAL parameter type to PDO parameter type
* *
* @param int $type Parameter type * @param int $type Parameter type
* @return int
*/ */
private function convertParamType(int $type) : int private function convertParamType(int $type) : int
{ {
if ( ! isset(self::PARAM_TYPE_MAP[$type])) { if (! isset(self::PARAM_TYPE_MAP[$type])) {
throw new \InvalidArgumentException('Invalid parameter type: ' . $type); throw new \InvalidArgumentException('Invalid parameter type: ' . $type);
} }
...@@ -224,7 +223,6 @@ class PDOStatement extends \PDOStatement implements Statement ...@@ -224,7 +223,6 @@ class PDOStatement extends \PDOStatement implements Statement
* Converts DBAL fetch mode to PDO fetch mode * Converts DBAL fetch mode to PDO fetch mode
* *
* @param int|null $fetchMode Fetch mode * @param int|null $fetchMode Fetch mode
* @return int|null
*/ */
private function convertFetchMode(?int $fetchMode) : ?int private function convertFetchMode(?int $fetchMode) : ?int
{ {
...@@ -232,7 +230,7 @@ class PDOStatement extends \PDOStatement implements Statement ...@@ -232,7 +230,7 @@ class PDOStatement extends \PDOStatement implements Statement
return null; return null;
} }
if ( ! isset(self::FETCH_MODE_MAP[$fetchMode])) { if (! isset(self::FETCH_MODE_MAP[$fetchMode])) {
throw new \InvalidArgumentException('Invalid fetch mode: ' . $fetchMode); throw new \InvalidArgumentException('Invalid fetch mode: ' . $fetchMode);
} }
......
...@@ -139,7 +139,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase ...@@ -139,7 +139,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
); );
if (isset($options['pdo'])) { if (isset($options['pdo'])) {
if ( ! extension_loaded('pdo')) { if (! extension_loaded('pdo')) {
$this->markTestSkipped('PDO is not installed'); $this->markTestSkipped('PDO is not installed');
} }
......
...@@ -113,7 +113,7 @@ class TestUtil ...@@ -113,7 +113,7 @@ class TestUtil
private static function getFallbackConnectionParams() private static function getFallbackConnectionParams()
{ {
if ( ! extension_loaded('pdo_sqlite')) { if (! extension_loaded('pdo_sqlite')) {
Assert::markTestSkipped('PDO SQLite extension is not loaded'); Assert::markTestSkipped('PDO SQLite extension is not loaded');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment