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
c197e485
Unverified
Commit
c197e485
authored
Jun 28, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing driver exception annotations
parent
babdc32e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
0 deletions
+45
-0
UPGRADE.md
UPGRADE.md
+15
-0
Connection.php
src/Driver/Connection.php
+10
-0
Statement.php
src/Driver/Mysqli/Statement.php
+2
-0
Statement.php
src/Driver/OCI8/Statement.php
+3
-0
Statement.php
src/Driver/PDO/Statement.php
+2
-0
Driver.php
src/Driver/PDOSqlsrv/Driver.php
+3
-0
Result.php
src/Driver/Result.php
+4
-0
ServerInfoAwareConnection.php
src/Driver/ServerInfoAwareConnection.php
+2
-0
Statement.php
src/Driver/Statement.php
+4
-0
No files found.
UPGRADE.md
View file @
c197e485
# Upgrade to 3.0
## BC BREAK: More driver-level methods are allowed to throw a Driver\Exception.
The following driver-level methods are allowed to throw a Driver
\E
xception:
-
`Connection::prepare()`
-
`Connection::lastInsertId()`
-
`Connection::beginTransaction()`
-
`Connection::commit()`
-
`Connection::rollBack()`
-
`ServerInfoAwareConnection::getServerVersion()`
-
`Statement::bindParam()`
-
`Statement::bindValue()`
-
`Result::rowCount()`
-
`Result::columnCount()`
## The `ExceptionConverterDriver` interface is removed
All drivers must implement the
`convertException()`
method which is now part of the
`Driver`
interface.
...
...
src/Driver/Connection.php
View file @
c197e485
...
...
@@ -15,6 +15,8 @@ interface Connection
{
/**
* Prepares a statement for execution and returns a Statement object.
*
* @throws Exception
*/
public
function
prepare
(
string
$sql
)
:
Statement
;
...
...
@@ -48,6 +50,8 @@ interface Connection
* @param string|null $name
*
* @return string
*
* @throws Exception
*/
public
function
lastInsertId
(
$name
=
null
);
...
...
@@ -55,6 +59,8 @@ interface Connection
* Initiates a transaction.
*
* @return bool TRUE on success or FALSE on failure.
*
* @throws Exception
*/
public
function
beginTransaction
();
...
...
@@ -62,6 +68,8 @@ interface Connection
* Commits a transaction.
*
* @return bool TRUE on success or FALSE on failure.
*
* @throws Exception
*/
public
function
commit
();
...
...
@@ -69,6 +77,8 @@ interface Connection
* Rolls back the current transaction, as initiated by beginTransaction().
*
* @return bool TRUE on success or FALSE on failure.
*
* @throws Exception
*/
public
function
rollBack
();
}
src/Driver/Mysqli/Statement.php
View file @
c197e485
...
...
@@ -142,6 +142,8 @@ final class Statement implements StatementInterface
/**
* Binds parameters with known types previously bound to the statement
*
* @throws Exception
*/
private
function
bindTypedParameters
()
:
void
{
...
...
src/Driver/OCI8/Statement.php
View file @
c197e485
...
...
@@ -2,6 +2,7 @@
namespace
Doctrine\DBAL\Driver\OCI8
;
use
Doctrine\DBAL\Driver\Exception
;
use
Doctrine\DBAL\Driver\OCI8\Exception\Error
;
use
Doctrine\DBAL\Driver\OCI8\Exception\UnknownParameterIndex
;
use
Doctrine\DBAL\Driver\Result
as
ResultInterface
;
...
...
@@ -54,6 +55,8 @@ final class Statement implements StatementInterface
*
* @param resource $dbh The connection handle.
* @param string $query The SQL query.
*
* @throws Exception
*/
public
function
__construct
(
$dbh
,
$query
,
ExecutionMode
$executionMode
)
{
...
...
src/Driver/PDO/Statement.php
View file @
c197e485
...
...
@@ -50,6 +50,8 @@ class Statement implements StatementInterface
}
/**
* {@inheritDoc}
*
* @param mixed $column
* @param mixed $variable
* @param int $type
...
...
src/Driver/PDOSqlsrv/Driver.php
View file @
c197e485
...
...
@@ -4,6 +4,7 @@ namespace Doctrine\DBAL\Driver\PDOSqlsrv;
use
Doctrine\DBAL\Driver\AbstractSQLServerDriver
;
use
Doctrine\DBAL\Driver\AbstractSQLServerDriver\Exception\PortWithoutHost
;
use
Doctrine\DBAL\Driver\Exception
;
use
PDO
;
use
function
is_int
;
...
...
@@ -50,6 +51,8 @@ class Driver extends AbstractSQLServerDriver
* @param string[] $connectionOptions
*
* @return string The DSN.
*
* @throws Exception
*/
private
function
_constructPdoDsn
(
array
$params
,
array
$connectionOptions
)
{
...
...
src/Driver/Result.php
View file @
c197e485
...
...
@@ -71,6 +71,8 @@ interface Result
* is not guaranteed for all drivers and should not be relied on in portable applications.
*
* @return int The number of rows.
*
* @throws Exception
*/
public
function
rowCount
()
:
int
;
...
...
@@ -79,6 +81,8 @@ interface Result
*
* @return int The number of columns in the result. If the columns cannot be counted,
* this method must return 0.
*
* @throws Exception
*/
public
function
columnCount
()
:
int
;
...
...
src/Driver/ServerInfoAwareConnection.php
View file @
c197e485
...
...
@@ -11,6 +11,8 @@ interface ServerInfoAwareConnection extends Connection
* Returns the version number of the database server connected to.
*
* @return string
*
* @throws Exception
*/
public
function
getServerVersion
();
}
src/Driver/Statement.php
View file @
c197e485
...
...
@@ -24,6 +24,8 @@ interface Statement
* constants.
*
* @return bool TRUE on success or FALSE on failure.
*
* @throws Exception
*/
public
function
bindValue
(
$param
,
$value
,
$type
=
ParameterType
::
STRING
);
...
...
@@ -51,6 +53,8 @@ interface Statement
* so that PHP allocates enough memory to hold the returned value.
*
* @return bool TRUE on success or FALSE on failure.
*
* @throws Exception
*/
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
ParameterType
::
STRING
,
$length
=
null
);
...
...
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