Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
0e99c343
Unverified
Commit
0e99c343
authored
Jan 28, 2018
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed code style
parent
7dadba43
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
29 deletions
+29
-29
ArrayStatement.php
lib/Doctrine/DBAL/Cache/ArrayStatement.php
+1
-1
ResultCacheStatement.php
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
+4
-4
Connection.php
lib/Doctrine/DBAL/Connection.php
+2
-2
DB2Connection.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
+1
-1
DB2Statement.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
+1
-1
MysqliStatement.php
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
+7
-5
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+7
-7
PDOStatement.php
lib/Doctrine/DBAL/Driver/PDOStatement.php
+2
-4
SQLSrvStatement.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
+2
-2
DriverManagerTest.php
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
+1
-1
TestUtil.php
tests/Doctrine/Tests/TestUtil.php
+1
-1
No files found.
lib/Doctrine/DBAL/Cache/ArrayStatement.php
View file @
0e99c343
...
...
@@ -100,7 +100,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
*/
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
;
}
...
...
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
View file @
0e99c343
...
...
@@ -160,19 +160,19 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
$fetchMode
=
$fetchMode
?:
$this
->
defaultFetchMode
;
if
(
$fetchMode
==
FetchMode
::
ASSOCIATIVE
)
{
if
(
$fetchMode
==
=
FetchMode
::
ASSOCIATIVE
)
{
return
$row
;
}
if
(
$fetchMode
==
FetchMode
::
NUMERIC
)
{
if
(
$fetchMode
==
=
FetchMode
::
NUMERIC
)
{
return
array_values
(
$row
);
}
if
(
$fetchMode
==
FetchMode
::
MIXED
)
{
if
(
$fetchMode
==
=
FetchMode
::
MIXED
)
{
return
array_merge
(
$row
,
array_values
(
$row
));
}
if
(
$fetchMode
==
FetchMode
::
COLUMN
)
{
if
(
$fetchMode
==
=
FetchMode
::
COLUMN
)
{
return
reset
(
$row
);
}
...
...
lib/Doctrine/DBAL/Connection.php
View file @
0e99c343
...
...
@@ -82,14 +82,14 @@ class Connection implements DriverConnection
*
* @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.
*
* @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.
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
View file @
0e99c343
...
...
@@ -103,7 +103,7 @@ class DB2Connection implements Connection, ServerInfoAwareConnection
{
$input
=
db2_escape_string
(
$input
);
if
(
$type
==
ParameterType
::
INTEGER
)
{
if
(
$type
==
=
ParameterType
::
INTEGER
)
{
return
$input
;
}
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
View file @
0e99c343
...
...
@@ -65,7 +65,7 @@ class DB2Statement implements \IteratorAggregate, Statement
*/
static
private
$_typeMap
=
[
ParameterType
::
INTEGER
=>
DB2_LONG
,
ParameterType
::
STRING
=>
DB2_CHAR
,
ParameterType
::
STRING
=>
DB2_CHAR
,
];
/**
...
...
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
View file @
0e99c343
...
...
@@ -33,11 +33,13 @@ class MysqliStatement implements \IteratorAggregate, Statement
* @var array
*/
protected
static
$_paramTypeMap
=
[
ParameterType
::
STRING
=>
's'
,
ParameterType
::
BOOLEAN
=>
'i'
,
ParameterType
::
NULL
=>
's'
,
ParameterType
::
INTEGER
=>
'i'
,
ParameterType
::
LARGE_OBJECT
=>
's'
// TODO Support LOB bigger then max package size.
ParameterType
::
STRING
=>
's'
,
ParameterType
::
BOOLEAN
=>
'i'
,
ParameterType
::
NULL
=>
's'
,
ParameterType
::
INTEGER
=>
'i'
,
// TODO Support LOB bigger then max package size
ParameterType
::
LARGE_OBJECT
=>
's'
,
];
/**
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
0e99c343
...
...
@@ -57,10 +57,10 @@ class OCI8Statement implements IteratorAggregate, Statement
* @var array
*/
protected
static
$fetchModeMap
=
[
FetchMode
::
MIXED
=>
OCI_BOTH
,
FetchMode
::
MIXED
=>
OCI_BOTH
,
FetchMode
::
ASSOCIATIVE
=>
OCI_ASSOC
,
FetchMode
::
NUMERIC
=>
OCI_NUM
,
FetchMode
::
COLUMN
=>
OCI_NUM
,
FetchMode
::
NUMERIC
=>
OCI_NUM
,
FetchMode
::
COLUMN
=>
OCI_NUM
,
];
/**
...
...
@@ -267,7 +267,7 @@ class OCI8Statement implements IteratorAggregate, Statement
{
$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
->
writeTemporary
(
$variable
,
OCI_TEMP_BLOB
);
...
...
@@ -415,7 +415,7 @@ class OCI8Statement implements IteratorAggregate, Statement
$result
=
[];
if
(
$fetchMode
==
FetchMode
::
STANDARD_OBJECT
)
{
if
(
$fetchMode
==
=
FetchMode
::
STANDARD_OBJECT
)
{
while
(
$row
=
$this
->
fetch
(
$fetchMode
))
{
$result
[]
=
$row
;
}
...
...
@@ -434,7 +434,7 @@ class OCI8Statement implements IteratorAggregate, Statement
}
else
{
$fetchStructure
=
OCI_FETCHSTATEMENT_BY_ROW
;
if
(
$fetchMode
==
FetchMode
::
COLUMN
)
{
if
(
$fetchMode
==
=
FetchMode
::
COLUMN
)
{
$fetchStructure
=
OCI_FETCHSTATEMENT_BY_COLUMN
;
}
...
...
@@ -447,7 +447,7 @@ class OCI8Statement implements IteratorAggregate, Statement
oci_fetch_all
(
$this
->
_sth
,
$result
,
0
,
-
1
,
self
::
$fetchModeMap
[
$fetchMode
]
|
OCI_RETURN_NULLS
|
$fetchStructure
|
OCI_RETURN_LOBS
);
if
(
$fetchMode
==
FetchMode
::
COLUMN
)
{
if
(
$fetchMode
==
=
FetchMode
::
COLUMN
)
{
$result
=
$result
[
0
];
}
}
...
...
lib/Doctrine/DBAL/Driver/PDOStatement.php
View file @
0e99c343
...
...
@@ -209,11 +209,10 @@ class PDOStatement extends \PDOStatement implements Statement
* Converts DBAL parameter type to PDO parameter type
*
* @param int $type Parameter type
* @return 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
);
}
...
...
@@ -224,7 +223,6 @@ class PDOStatement extends \PDOStatement implements Statement
* Converts DBAL fetch mode to PDO fetch mode
*
* @param int|null $fetchMode Fetch mode
* @return int|null
*/
private
function
convertFetchMode
(
?
int
$fetchMode
)
:
?
int
{
...
...
@@ -232,7 +230,7 @@ class PDOStatement extends \PDOStatement implements Statement
return
null
;
}
if
(
!
isset
(
self
::
FETCH_MODE_MAP
[
$fetchMode
]))
{
if
(
!
isset
(
self
::
FETCH_MODE_MAP
[
$fetchMode
]))
{
throw
new
\InvalidArgumentException
(
'Invalid fetch mode: '
.
$fetchMode
);
}
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
View file @
0e99c343
...
...
@@ -74,9 +74,9 @@ class SQLSrvStatement implements IteratorAggregate, Statement
* @var array
*/
private
static
$fetchMap
=
[
FetchMode
::
MIXED
=>
SQLSRV_FETCH_BOTH
,
FetchMode
::
MIXED
=>
SQLSRV_FETCH_BOTH
,
FetchMode
::
ASSOCIATIVE
=>
SQLSRV_FETCH_ASSOC
,
FetchMode
::
NUMERIC
=>
SQLSRV_FETCH_NUMERIC
,
FetchMode
::
NUMERIC
=>
SQLSRV_FETCH_NUMERIC
,
];
/**
...
...
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
View file @
0e99c343
...
...
@@ -139,7 +139,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
);
if
(
isset
(
$options
[
'pdo'
]))
{
if
(
!
extension_loaded
(
'pdo'
))
{
if
(
!
extension_loaded
(
'pdo'
))
{
$this
->
markTestSkipped
(
'PDO is not installed'
);
}
...
...
tests/Doctrine/Tests/TestUtil.php
View file @
0e99c343
...
...
@@ -113,7 +113,7 @@ class TestUtil
private
static
function
getFallbackConnectionParams
()
{
if
(
!
extension_loaded
(
'pdo_sqlite'
))
{
if
(
!
extension_loaded
(
'pdo_sqlite'
))
{
Assert
::
markTestSkipped
(
'PDO SQLite extension is not loaded'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment