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
32dd9090
Unverified
Commit
32dd9090
authored
Jun 19, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify the type of the first argument in Statement::bind*() methods
parent
f930ea82
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
15 deletions
+26
-15
DB2Statement.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
+6
-0
SQLAnywhereStatement.php
...Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
+5
-0
Statement.php
lib/Doctrine/DBAL/Driver/Statement.php
+15
-15
No files found.
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
View file @
32dd9090
...
...
@@ -13,6 +13,7 @@ use ReflectionObject;
use
ReflectionProperty
;
use
stdClass
;
use
function
array_change_key_case
;
use
function
assert
;
use
function
db2_bind_param
;
use
function
db2_execute
;
use
function
db2_fetch_array
;
...
...
@@ -30,6 +31,7 @@ use function func_get_args;
use
function
func_num_args
;
use
function
fwrite
;
use
function
gettype
;
use
function
is_int
;
use
function
is_object
;
use
function
is_resource
;
use
function
is_string
;
...
...
@@ -91,6 +93,8 @@ class DB2Statement implements IteratorAggregate, Statement
*/
public
function
bindValue
(
$param
,
$value
,
$type
=
ParameterType
::
STRING
)
{
assert
(
is_int
(
$param
));
return
$this
->
bindParam
(
$param
,
$value
,
$type
);
}
...
...
@@ -99,6 +103,8 @@ class DB2Statement implements IteratorAggregate, Statement
*/
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
ParameterType
::
STRING
,
$length
=
null
)
{
assert
(
is_int
(
$column
));
switch
(
$type
)
{
case
ParameterType
::
INTEGER
:
$this
->
bind
(
$column
,
$variable
,
DB2_PARAM_IN
,
DB2_LONG
);
...
...
lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
View file @
32dd9090
...
...
@@ -12,6 +12,7 @@ use ReflectionClass;
use
ReflectionObject
;
use
stdClass
;
use
function
array_key_exists
;
use
function
assert
;
use
function
func_get_args
;
use
function
func_num_args
;
use
function
gettype
;
...
...
@@ -91,6 +92,8 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement
*/
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
ParameterType
::
STRING
,
$length
=
null
)
{
assert
(
is_int
(
$column
));
switch
(
$type
)
{
case
ParameterType
::
INTEGER
:
case
ParameterType
::
BOOLEAN
:
...
...
@@ -125,6 +128,8 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement
*/
public
function
bindValue
(
$param
,
$value
,
$type
=
ParameterType
::
STRING
)
{
assert
(
is_int
(
$param
));
return
$this
->
bindParam
(
$param
,
$value
,
$type
);
}
...
...
lib/Doctrine/DBAL/Driver/Statement.php
View file @
32dd9090
...
...
@@ -19,12 +19,12 @@ interface Statement extends ResultStatement
* 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.
*
* @param
mixed
$param Parameter identifier. For a prepared statement using named placeholders,
* 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.
* @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}
* constants.
* @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
*
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 int
$type Explicit data type for the parameter using the {@link \Doctrine\DBAL\ParameterType}
*
constants.
*
* @return bool TRUE on success or FALSE on failure.
*/
...
...
@@ -44,15 +44,15 @@ interface Statement extends ResultStatement
* 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.
*
* @param
mixed
$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
* 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 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
* 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
* so that PHP allocates enough memory to hold the returned value.
* @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
*
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 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
*
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
*
so that PHP allocates enough memory to hold the returned value.
*
* @return bool TRUE on success or FALSE on failure.
*/
...
...
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