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
f7e8b5f1
Unverified
Commit
f7e8b5f1
authored
Jun 20, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.10.x' into 2.11.x
parents
932df081
3caae110
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
138 additions
and
49 deletions
+138
-49
Connection.php
lib/Doctrine/DBAL/Connection.php
+3
-2
AbstractMySQLDriver.php
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
+10
-1
AbstractPostgreSQLDriver.php
lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php
+10
-1
AbstractSQLAnywhereDriver.php
lib/Doctrine/DBAL/Driver/AbstractSQLAnywhereDriver.php
+10
-1
AbstractSQLServerDriver.php
lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver.php
+10
-1
DB2Statement.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
+6
-0
OCI8Connection.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
+3
-2
PDOConnection.php
lib/Doctrine/DBAL/Driver/PDOConnection.php
+4
-1
SQLAnywhereStatement.php
...Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
+5
-0
SQLSrvConnection.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
+1
-1
Statement.php
lib/Doctrine/DBAL/Driver/Statement.php
+15
-15
QueryBuilder.php
lib/Doctrine/DBAL/Query/QueryBuilder.php
+1
-1
phpstan.neon.dist
phpstan.neon.dist
+5
-0
psalm.xml
psalm.xml
+19
-1
DriverTest.php
...Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php
+1
-1
StatementIteratorTest.php
tests/Doctrine/Tests/DBAL/Driver/StatementIteratorTest.php
+6
-1
DriverTest.php
...ine/Tests/DBAL/Functional/Driver/PDOSqlsrv/DriverTest.php
+2
-2
DBAL630Test.php
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
+13
-4
AbstractMySQLPlatformTestCase.php
...ne/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
+1
-1
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+1
-1
AbstractPostgreSqlPlatformTestCase.php
...sts/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
+1
-1
AbstractSQLServerPlatformTestCase.php
...ests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
+1
-1
DB2PlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/DB2PlatformTest.php
+1
-1
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+6
-6
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+1
-1
SqlitePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
+2
-2
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
f7e8b5f1
...
@@ -13,7 +13,6 @@ use Doctrine\DBAL\Driver\Connection as DriverConnection;
...
@@ -13,7 +13,6 @@ use Doctrine\DBAL\Driver\Connection as DriverConnection;
use
Doctrine\DBAL\Driver\PingableConnection
;
use
Doctrine\DBAL\Driver\PingableConnection
;
use
Doctrine\DBAL\Driver\ResultStatement
;
use
Doctrine\DBAL\Driver\ResultStatement
;
use
Doctrine\DBAL\Driver\ServerInfoAwareConnection
;
use
Doctrine\DBAL\Driver\ServerInfoAwareConnection
;
use
Doctrine\DBAL\Driver\Statement
as
DriverStatement
;
use
Doctrine\DBAL\Exception\InvalidArgumentException
;
use
Doctrine\DBAL\Exception\InvalidArgumentException
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\DBAL\Query\Expression\ExpressionBuilder
;
use
Doctrine\DBAL\Query\Expression\ExpressionBuilder
;
...
@@ -1098,7 +1097,7 @@ class Connection implements DriverConnection
...
@@ -1098,7 +1097,7 @@ class Connection implements DriverConnection
*
*
* @param string $statement The SQL statement to prepare.
* @param string $statement The SQL statement to prepare.
*
*
* @return
Driver
Statement The prepared statement.
* @return Statement The prepared statement.
*
*
* @throws DBALException
* @throws DBALException
*/
*/
...
@@ -1709,6 +1708,8 @@ class Connection implements DriverConnection
...
@@ -1709,6 +1708,8 @@ class Connection implements DriverConnection
{
{
$this
->
connect
();
$this
->
connect
();
assert
(
$this
->
_conn
!==
null
);
return
$this
->
_conn
;
return
$this
->
_conn
;
}
}
...
...
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
View file @
f7e8b5f1
...
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Platforms\MySqlPlatform;
...
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Platforms\MySqlPlatform;
use
Doctrine\DBAL\Schema\MySqlSchemaManager
;
use
Doctrine\DBAL\Schema\MySqlSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
stripos
;
use
function
stripos
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -204,7 +205,15 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -204,7 +205,15 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT DATABASE()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT DATABASE()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php
View file @
f7e8b5f1
...
@@ -14,6 +14,7 @@ use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
...
@@ -14,6 +14,7 @@ use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use
Doctrine\DBAL\Schema\PostgreSqlSchemaManager
;
use
Doctrine\DBAL\Schema\PostgreSqlSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
strpos
;
use
function
strpos
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -122,7 +123,15 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
...
@@ -122,7 +123,15 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT CURRENT_DATABASE()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT CURRENT_DATABASE()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/AbstractSQLAnywhereDriver.php
View file @
f7e8b5f1
...
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Platforms\SQLAnywherePlatform;
...
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Platforms\SQLAnywherePlatform;
use
Doctrine\DBAL\Schema\SQLAnywhereSchemaManager
;
use
Doctrine\DBAL\Schema\SQLAnywhereSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -124,7 +125,15 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr
...
@@ -124,7 +125,15 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver.php
View file @
f7e8b5f1
...
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform;
...
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform;
use
Doctrine\DBAL\Schema\SQLServerSchemaManager
;
use
Doctrine\DBAL\Schema\SQLServerSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -65,7 +66,15 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr
...
@@ -65,7 +66,15 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
View file @
f7e8b5f1
...
@@ -17,6 +17,7 @@ use ReflectionProperty;
...
@@ -17,6 +17,7 @@ use ReflectionProperty;
use
stdClass
;
use
stdClass
;
use
function
array_change_key_case
;
use
function
array_change_key_case
;
use
function
assert
;
use
function
db2_bind_param
;
use
function
db2_bind_param
;
use
function
db2_execute
;
use
function
db2_execute
;
use
function
db2_fetch_array
;
use
function
db2_fetch_array
;
...
@@ -34,6 +35,7 @@ use function func_get_args;
...
@@ -34,6 +35,7 @@ use function func_get_args;
use
function
func_num_args
;
use
function
func_num_args
;
use
function
fwrite
;
use
function
fwrite
;
use
function
gettype
;
use
function
gettype
;
use
function
is_int
;
use
function
is_object
;
use
function
is_object
;
use
function
is_resource
;
use
function
is_resource
;
use
function
is_string
;
use
function
is_string
;
...
@@ -96,6 +98,8 @@ class DB2Statement implements IteratorAggregate, Statement, Result
...
@@ -96,6 +98,8 @@ class DB2Statement implements IteratorAggregate, Statement, Result
*/
*/
public
function
bindValue
(
$param
,
$value
,
$type
=
ParameterType
::
STRING
)
public
function
bindValue
(
$param
,
$value
,
$type
=
ParameterType
::
STRING
)
{
{
assert
(
is_int
(
$param
));
return
$this
->
bindParam
(
$param
,
$value
,
$type
);
return
$this
->
bindParam
(
$param
,
$value
,
$type
);
}
}
...
@@ -104,6 +108,8 @@ class DB2Statement implements IteratorAggregate, Statement, Result
...
@@ -104,6 +108,8 @@ class DB2Statement implements IteratorAggregate, Statement, Result
*/
*/
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
ParameterType
::
STRING
,
$length
=
null
)
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
ParameterType
::
STRING
,
$length
=
null
)
{
{
assert
(
is_int
(
$column
));
switch
(
$type
)
{
switch
(
$type
)
{
case
ParameterType
::
INTEGER
:
case
ParameterType
::
INTEGER
:
$this
->
bind
(
$column
,
$variable
,
DB2_PARAM_IN
,
DB2_LONG
);
$this
->
bind
(
$column
,
$variable
,
DB2_PARAM_IN
,
DB2_LONG
);
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
View file @
f7e8b5f1
...
@@ -226,11 +226,12 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
...
@@ -226,11 +226,12 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
public
function
errorCode
()
public
function
errorCode
()
{
{
$error
=
oci_error
(
$this
->
dbh
);
$error
=
oci_error
(
$this
->
dbh
);
if
(
$error
!==
false
)
{
if
(
$error
!==
false
)
{
$error
=
$error
[
'code'
];
return
$error
[
'code'
];
}
}
return
$error
;
return
null
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/PDOConnection.php
View file @
f7e8b5f1
...
@@ -39,7 +39,10 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
...
@@ -39,7 +39,10 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
public
function
exec
(
$statement
)
public
function
exec
(
$statement
)
{
{
try
{
try
{
return
parent
::
exec
(
$statement
);
$result
=
parent
::
exec
(
$statement
);
assert
(
$result
!==
false
);
return
$result
;
}
catch
(
\PDOException
$exception
)
{
}
catch
(
\PDOException
$exception
)
{
throw
new
PDOException
(
$exception
);
throw
new
PDOException
(
$exception
);
}
}
...
...
lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
View file @
f7e8b5f1
...
@@ -16,6 +16,7 @@ use ReflectionObject;
...
@@ -16,6 +16,7 @@ use ReflectionObject;
use
stdClass
;
use
stdClass
;
use
function
array_key_exists
;
use
function
array_key_exists
;
use
function
assert
;
use
function
func_get_args
;
use
function
func_get_args
;
use
function
func_num_args
;
use
function
func_num_args
;
use
function
gettype
;
use
function
gettype
;
...
@@ -96,6 +97,8 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement, Result
...
@@ -96,6 +97,8 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement, Result
*/
*/
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
ParameterType
::
STRING
,
$length
=
null
)
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
ParameterType
::
STRING
,
$length
=
null
)
{
{
assert
(
is_int
(
$column
));
switch
(
$type
)
{
switch
(
$type
)
{
case
ParameterType
::
INTEGER
:
case
ParameterType
::
INTEGER
:
case
ParameterType
::
BOOLEAN
:
case
ParameterType
::
BOOLEAN
:
...
@@ -130,6 +133,8 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement, Result
...
@@ -130,6 +133,8 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement, Result
*/
*/
public
function
bindValue
(
$param
,
$value
,
$type
=
ParameterType
::
STRING
)
public
function
bindValue
(
$param
,
$value
,
$type
=
ParameterType
::
STRING
)
{
{
assert
(
is_int
(
$param
));
return
$this
->
bindParam
(
$param
,
$value
,
$type
);
return
$this
->
bindParam
(
$param
,
$value
,
$type
);
}
}
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
View file @
f7e8b5f1
...
@@ -199,7 +199,7 @@ class SQLSrvConnection implements Connection, ServerInfoAwareConnection
...
@@ -199,7 +199,7 @@ class SQLSrvConnection implements Connection, ServerInfoAwareConnection
return
$errors
[
0
][
'code'
];
return
$errors
[
0
][
'code'
];
}
}
return
false
;
return
null
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/Statement.php
View file @
f7e8b5f1
...
@@ -19,12 +19,12 @@ interface Statement extends ResultStatement
...
@@ -19,12 +19,12 @@ interface Statement extends ResultStatement
* As mentioned above, the named parameters are not natively supported by the mysqli driver, use executeQuery(),
* As mentioned above, the named parameters are not natively supported by the mysqli driver, use executeQuery(),
* fetchAll(), fetchArray(), fetchColumn(), fetchAssoc() methods to have the named parameter emulated by doctrine.
* fetchAll(), fetchArray(), fetchColumn(), fetchAssoc() methods to have the named parameter emulated by doctrine.
*
*
* @param
mixed
$param Parameter identifier. For a prepared statement using named placeholders,
* @param
int|string
$param Parameter identifier. For a prepared statement using named placeholders,
* this will be a parameter name of the form :name. For a prepared statement
*
this will be a parameter name of the form :name. For a prepared statement
* using question mark placeholders, this will be the 1-indexed position of the parameter.
*
using question mark placeholders, this will be the 1-indexed position of the parameter.
* @param mixed $value The value to bind to the parameter.
* @param mixed
$value The value to bind to the parameter.
* @param int $type Explicit data type for the parameter using the {@link \Doctrine\DBAL\ParameterType}
* @param int
$type Explicit data type for the parameter using the {@link \Doctrine\DBAL\ParameterType}
* constants.
*
constants.
*
*
* @return bool TRUE on success or FALSE on failure.
* @return bool TRUE on success or FALSE on failure.
*/
*/
...
@@ -44,15 +44,15 @@ interface Statement extends ResultStatement
...
@@ -44,15 +44,15 @@ interface Statement extends ResultStatement
* of stored procedures that return data as output parameters, and some also as input/output
* of stored procedures that return data as output parameters, and some also as input/output
* parameters that both send in data and are updated to receive it.
* parameters that both send in data and are updated to receive it.
*
*
* @param
mixed
$column Parameter identifier. For a prepared statement using named placeholders,
* @param
int|string
$column Parameter identifier. For a prepared statement using named placeholders,
* this will be a parameter name of the form :name. For a prepared statement using
*
this will be a parameter name of the form :name. For a prepared statement using
* question mark placeholders, this will be the 1-indexed position of the parameter.
*
question mark placeholders, this will be the 1-indexed position of the parameter.
* @param mixed $variable Name of the PHP variable to bind to the SQL statement parameter.
* @param mixed
$variable Name of the PHP variable to bind to the SQL statement parameter.
* @param int $type Explicit data type for the parameter using the {@link \Doctrine\DBAL\ParameterType}
* @param int
$type Explicit data type for the parameter using the {@link \Doctrine\DBAL\ParameterType}
* constants. To return an INOUT parameter from a stored procedure, use the bitwise
*
constants. To return an INOUT parameter from a stored procedure, use the bitwise
* OR operator to set the PDO::PARAM_INPUT_OUTPUT bits for the data_type parameter.
*
OR operator to set the PDO::PARAM_INPUT_OUTPUT bits for the data_type parameter.
* @param int|null $length You must specify maxlength when using an OUT bind
* @param int|null
$length You must specify maxlength when using an OUT bind
* so that PHP allocates enough memory to hold the returned value.
*
so that PHP allocates enough memory to hold the returned value.
*
*
* @return bool TRUE on success or FALSE on failure.
* @return bool TRUE on success or FALSE on failure.
*/
*/
...
...
lib/Doctrine/DBAL/Query/QueryBuilder.php
View file @
f7e8b5f1
...
@@ -396,7 +396,7 @@ class QueryBuilder
...
@@ -396,7 +396,7 @@ class QueryBuilder
* Gets the maximum number of results the query object was set to retrieve (the "limit").
* Gets the maximum number of results the query object was set to retrieve (the "limit").
* Returns NULL if all results will be returned.
* Returns NULL if all results will be returned.
*
*
* @return int The maximum number of results.
* @return int
|null
The maximum number of results.
*/
*/
public
function
getMaxResults
()
public
function
getMaxResults
()
{
{
...
...
phpstan.neon.dist
View file @
f7e8b5f1
...
@@ -95,3 +95,8 @@ parameters:
...
@@ -95,3 +95,8 @@ parameters:
message: '~Method Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Connection\:\:lastInsertId\(\) should return string but returns string\|false\|null\.~'
message: '~Method Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Connection\:\:lastInsertId\(\) should return string but returns string\|false\|null\.~'
paths:
paths:
- %currentWorkingDirectory%/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php
- %currentWorkingDirectory%/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php
-
message: '~Method Doctrine\\DBAL\\Portability\\Connection::prepare\(\) should return Doctrine\\DBAL\\Statement but returns Doctrine\\DBAL\\Portability\\Statement\.~'
paths:
- %currentWorkingDirectory%/lib/Doctrine/DBAL/Portability/Connection.php
psalm.xml
View file @
f7e8b5f1
<?xml version="1.0"?>
<?xml version="1.0"?>
<psalm
<psalm
totallyTyped=
"false"
totallyTyped=
"false"
errorLevel=
"
6
"
errorLevel=
"
5
"
resolveFromConfigFile=
"true"
resolveFromConfigFile=
"true"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"https://getpsalm.org/schema/config"
xmlns=
"https://getpsalm.org/schema/config"
...
@@ -32,6 +32,16 @@
...
@@ -32,6 +32,16 @@
<file
name=
"lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php"
/>
<file
name=
"lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php"
/>
</errorLevel>
</errorLevel>
</ConflictingReferenceConstraint>
</ConflictingReferenceConstraint>
<FalsableReturnStatement>
<errorLevel
type=
"suppress"
>
<!--
Fixing these issues requires an API change
-->
<file
name=
"lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php"
/>
<file
name=
"lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereConnection.php"
/>
<file
name=
"lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php"
/>
</errorLevel>
</FalsableReturnStatement>
<MethodSignatureMismatch>
<MethodSignatureMismatch>
<errorLevel
type=
"suppress"
>
<errorLevel
type=
"suppress"
>
<!--
<!--
...
@@ -41,6 +51,14 @@
...
@@ -41,6 +51,14 @@
<file
name=
"lib/Doctrine/DBAL/Driver/PDOConnection.php"
/>
<file
name=
"lib/Doctrine/DBAL/Driver/PDOConnection.php"
/>
</errorLevel>
</errorLevel>
</MethodSignatureMismatch>
</MethodSignatureMismatch>
<NullableReturnStatement>
<errorLevel
type=
"suppress"
>
<!--
Fixing this issue requires an API change
-->
<file
name=
"lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php"
/>
</errorLevel>
</NullableReturnStatement>
<TooFewArguments>
<TooFewArguments>
<errorLevel
type=
"suppress"
>
<errorLevel
type=
"suppress"
>
<!--
<!--
...
...
tests/Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php
View file @
f7e8b5f1
...
@@ -39,7 +39,7 @@ class DriverTest extends PDOMySQLDriverTest
...
@@ -39,7 +39,7 @@ class DriverTest extends PDOMySQLDriverTest
}
}
/**
/**
*
@return mixed[][]
*
{@inheritDoc}
*/
*/
protected
function
getDatabasePlatformsForVersions
()
:
array
protected
function
getDatabasePlatformsForVersions
()
:
array
{
{
...
...
tests/Doctrine/Tests/DBAL/Driver/StatementIteratorTest.php
View file @
f7e8b5f1
...
@@ -5,12 +5,14 @@ namespace Doctrine\Tests\DBAL\Driver;
...
@@ -5,12 +5,14 @@ namespace Doctrine\Tests\DBAL\Driver;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Statement
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Statement
;
use
Doctrine\DBAL\Driver\Mysqli\MysqliStatement
;
use
Doctrine\DBAL\Driver\Mysqli\MysqliStatement
;
use
Doctrine\DBAL\Driver\OCI8\OCI8Statement
;
use
Doctrine\DBAL\Driver\OCI8\OCI8Statement
;
use
Doctrine\DBAL\Driver\ResultStatement
;
use
Doctrine\DBAL\Driver\SQLAnywhere\SQLAnywhereStatement
;
use
Doctrine\DBAL\Driver\SQLAnywhere\SQLAnywhereStatement
;
use
Doctrine\DBAL\Driver\SQLSrv\SQLSrvStatement
;
use
Doctrine\DBAL\Driver\SQLSrv\SQLSrvStatement
;
use
Doctrine\DBAL\Driver\Statement
;
use
Doctrine\DBAL\Driver\Statement
;
use
Doctrine\DBAL\Driver\StatementIterator
;
use
Doctrine\DBAL\Driver\StatementIterator
;
use
Doctrine\DBAL\Portability\Statement
as
PortabilityStatement
;
use
Doctrine\DBAL\Portability\Statement
as
PortabilityStatement
;
use
Doctrine\Tests\DbalTestCase
;
use
Doctrine\Tests\DbalTestCase
;
use
IteratorIterator
;
use
PHPUnit\Framework\MockObject\MockObject
;
use
PHPUnit\Framework\MockObject\MockObject
;
use
Traversable
;
use
Traversable
;
...
@@ -19,16 +21,19 @@ use function extension_loaded;
...
@@ -19,16 +21,19 @@ use function extension_loaded;
class
StatementIteratorTest
extends
DbalTestCase
class
StatementIteratorTest
extends
DbalTestCase
{
{
/**
/**
* @param class-string<ResultStatement> $class
*
* @dataProvider statementProvider()
* @dataProvider statementProvider()
*/
*/
public
function
testGettingIteratorDoesNotCallFetch
(
string
$class
)
:
void
public
function
testGettingIteratorDoesNotCallFetch
(
string
$class
)
:
void
{
{
$stmt
=
$this
->
createPartialMock
(
$class
,
[
'fetch'
,
'fetchAll'
,
'fetchColumn'
]);
$stmt
=
$this
->
createPartialMock
(
$class
,
[
'fetch'
,
'fetchAll'
,
'fetchColumn'
]);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetch'
);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetch'
);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetchAll'
);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetchAll'
);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetchColumn'
);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetchColumn'
);
$stmt
->
getIterator
(
);
new
IteratorIterator
(
$stmt
);
}
}
public
function
testIteratorIterationCallsFetchOncePerStep
()
:
void
public
function
testIteratorIterationCallsFetchOncePerStep
()
:
void
...
...
tests/Doctrine/Tests/DBAL/Functional/Driver/PDOSqlsrv/DriverTest.php
View file @
f7e8b5f1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
Doctrine\Tests\DBAL\Functional\Driver\PDOSqlsrv
;
namespace
Doctrine\Tests\DBAL\Functional\Driver\PDOSqlsrv
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\Connection
;
use
Doctrine\DBAL\Driver\
PDO
Connection
;
use
Doctrine\DBAL\Driver\PDOSqlsrv\Driver
;
use
Doctrine\DBAL\Driver\PDOSqlsrv\Driver
;
use
Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest
;
use
Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest
;
use
Doctrine\Tests\TestUtil
;
use
Doctrine\Tests\TestUtil
;
...
@@ -41,7 +41,7 @@ class DriverTest extends AbstractDriverTest
...
@@ -41,7 +41,7 @@ class DriverTest extends AbstractDriverTest
/**
/**
* @param int[]|string[] $driverOptions
* @param int[]|string[] $driverOptions
*/
*/
pr
otected
function
getConnection
(
array
$driverOptions
)
:
Connection
pr
ivate
function
getConnection
(
array
$driverOptions
)
:
PDO
Connection
{
{
$params
=
TestUtil
::
getConnectionParams
();
$params
=
TestUtil
::
getConnectionParams
();
...
...
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
View file @
f7e8b5f1
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL\Functional\Ticket
;
namespace
Doctrine\Tests\DBAL\Functional\Ticket
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Driver\PDOConnection
;
use
Doctrine\DBAL\ParameterType
;
use
Doctrine\DBAL\ParameterType
;
use
Doctrine\Tests\DbalFunctionalTestCase
;
use
Doctrine\Tests\DbalFunctionalTestCase
;
use
PDO
;
use
PDO
;
...
@@ -39,7 +40,7 @@ class DBAL630Test extends DbalFunctionalTestCase
...
@@ -39,7 +40,7 @@ class DBAL630Test extends DbalFunctionalTestCase
protected
function
tearDown
()
:
void
protected
function
tearDown
()
:
void
{
{
if
(
$this
->
running
)
{
if
(
$this
->
running
)
{
$this
->
connection
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
false
);
$this
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
false
);
}
}
parent
::
tearDown
();
parent
::
tearDown
();
...
@@ -73,7 +74,7 @@ class DBAL630Test extends DbalFunctionalTestCase
...
@@ -73,7 +74,7 @@ class DBAL630Test extends DbalFunctionalTestCase
public
function
testBooleanConversionBoolParamEmulatedPrepares
()
:
void
public
function
testBooleanConversionBoolParamEmulatedPrepares
()
:
void
{
{
$this
->
connection
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$platform
=
$this
->
connection
->
getDatabasePlatform
();
$platform
=
$this
->
connection
->
getDatabasePlatform
();
...
@@ -97,7 +98,7 @@ class DBAL630Test extends DbalFunctionalTestCase
...
@@ -97,7 +98,7 @@ class DBAL630Test extends DbalFunctionalTestCase
?
bool
$statementValue
,
?
bool
$statementValue
,
?
bool
$databaseConvertedValue
?
bool
$databaseConvertedValue
)
:
void
{
)
:
void
{
$this
->
connection
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$platform
=
$this
->
connection
->
getDatabasePlatform
();
$platform
=
$this
->
connection
->
getDatabasePlatform
();
...
@@ -121,7 +122,7 @@ class DBAL630Test extends DbalFunctionalTestCase
...
@@ -121,7 +122,7 @@ class DBAL630Test extends DbalFunctionalTestCase
?
bool
$statementValue
,
?
bool
$statementValue
,
bool
$databaseConvertedValue
bool
$databaseConvertedValue
)
:
void
{
)
:
void
{
$this
->
connection
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$platform
=
$this
->
connection
->
getDatabasePlatform
();
$platform
=
$this
->
connection
->
getDatabasePlatform
();
...
@@ -171,4 +172,12 @@ class DBAL630Test extends DbalFunctionalTestCase
...
@@ -171,4 +172,12 @@ class DBAL630Test extends DbalFunctionalTestCase
[
null
,
null
],
[
null
,
null
],
];
];
}
}
private
function
getWrappedConnection
()
:
PDOConnection
{
$connection
=
$this
->
connection
->
getWrappedConnection
();
self
::
assertInstanceOf
(
PDOConnection
::
class
,
$connection
);
return
$connection
;
}
}
}
tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
View file @
f7e8b5f1
...
@@ -153,7 +153,7 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
...
@@ -153,7 +153,7 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
return
'CREATE UNIQUE INDEX index_name ON test (test, test2)'
;
return
'CREATE UNIQUE INDEX index_name ON test (test, test2)'
;
}
}
p
ublic
function
getGenerateForeignKeySql
()
:
string
p
rotected
function
getGenerateForeignKeySql
()
:
string
{
{
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
f7e8b5f1
...
@@ -251,7 +251,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase
...
@@ -251,7 +251,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase
self
::
assertEquals
(
$sql
,
$this
->
getGenerateForeignKeySql
());
self
::
assertEquals
(
$sql
,
$this
->
getGenerateForeignKeySql
());
}
}
abstract
p
ublic
function
getGenerateForeignKeySql
()
:
string
;
abstract
p
rotected
function
getGenerateForeignKeySql
()
:
string
;
public
function
testGeneratesConstraintCreationSql
()
:
void
public
function
testGeneratesConstraintCreationSql
()
:
void
{
{
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
View file @
f7e8b5f1
...
@@ -66,7 +66,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
...
@@ -66,7 +66,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
return
'CREATE INDEX my_idx ON mytable (user_name, last_login)'
;
return
'CREATE INDEX my_idx ON mytable (user_name, last_login)'
;
}
}
p
ublic
function
getGenerateForeignKeySql
()
:
string
p
rotected
function
getGenerateForeignKeySql
()
:
string
{
{
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id) NOT DEFERRABLE INITIALLY IMMEDIATE'
;
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id) NOT DEFERRABLE INITIALLY IMMEDIATE'
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
View file @
f7e8b5f1
...
@@ -182,7 +182,7 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
...
@@ -182,7 +182,7 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
return
'CREATE UNIQUE INDEX index_name ON test (test, test2) WHERE test IS NOT NULL AND test2 IS NOT NULL'
;
return
'CREATE UNIQUE INDEX index_name ON test (test, test2) WHERE test IS NOT NULL AND test2 IS NOT NULL'
;
}
}
p
ublic
function
getGenerateForeignKeySql
()
:
string
p
rotected
function
getGenerateForeignKeySql
()
:
string
{
{
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/DB2PlatformTest.php
View file @
f7e8b5f1
...
@@ -42,7 +42,7 @@ class DB2PlatformTest extends AbstractPlatformTestCase
...
@@ -42,7 +42,7 @@ class DB2PlatformTest extends AbstractPlatformTestCase
];
];
}
}
p
ublic
function
getGenerateForeignKeySql
()
:
string
p
rotected
function
getGenerateForeignKeySql
()
:
string
{
{
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
f7e8b5f1
...
@@ -94,7 +94,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -94,7 +94,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
}
}
/**
/**
*
@return mixed[]
*
{@inheritDoc}
*/
*/
public
function
getGenerateTableWithMultiColumnUniqueIndexSql
()
:
array
public
function
getGenerateTableWithMultiColumnUniqueIndexSql
()
:
array
{
{
...
@@ -235,7 +235,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -235,7 +235,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
return
'CREATE UNIQUE INDEX index_name ON test (test, test2)'
;
return
'CREATE UNIQUE INDEX index_name ON test (test, test2)'
;
}
}
p
ublic
function
getGenerateForeignKeySql
()
:
string
p
rotected
function
getGenerateForeignKeySql
()
:
string
{
{
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
}
}
...
@@ -409,7 +409,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -409,7 +409,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
}
}
/**
/**
*
@return mixed[]
*
{@inheritDoc}
*/
*/
protected
function
getQuotedColumnInPrimaryKeySQL
()
:
array
protected
function
getQuotedColumnInPrimaryKeySQL
()
:
array
{
{
...
@@ -417,7 +417,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -417,7 +417,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
}
}
/**
/**
*
@return mixed[]
*
{@inheritDoc}
*/
*/
protected
function
getQuotedColumnInIndexSQL
()
:
array
protected
function
getQuotedColumnInIndexSQL
()
:
array
{
{
...
@@ -428,7 +428,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -428,7 +428,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
}
}
/**
/**
*
@return mixed[]
*
{@inheritDoc}
*/
*/
protected
function
getQuotedNameInIndexSQL
()
:
array
protected
function
getQuotedNameInIndexSQL
()
:
array
{
{
...
@@ -439,7 +439,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -439,7 +439,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
}
}
/**
/**
*
@return mixed[]
*
{@inheritDoc}
*/
*/
protected
function
getQuotedColumnInForeignKeySQL
()
:
array
protected
function
getQuotedColumnInForeignKeySQL
()
:
array
{
{
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
f7e8b5f1
...
@@ -44,7 +44,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
...
@@ -44,7 +44,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
];
];
}
}
p
ublic
function
getGenerateForeignKeySql
()
:
string
p
rotected
function
getGenerateForeignKeySql
()
:
string
{
{
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
View file @
f7e8b5f1
...
@@ -286,9 +286,9 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
...
@@ -286,9 +286,9 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
parent
::
testGeneratesConstraintCreationSql
();
parent
::
testGeneratesConstraintCreationSql
();
}
}
p
ublic
function
getGenerateForeignKeySql
()
:
string
p
rotected
function
getGenerateForeignKeySql
()
:
string
{
{
return
null
;
return
''
;
}
}
public
function
testModifyLimitQuery
()
:
void
public
function
testModifyLimitQuery
()
:
void
...
...
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