-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation on DBAL\Driver\Statement::bindValue
is incorrect
#4212
Conversation
This change updates the documentation on the `bindValue` function. Per the implementation this function can take a string, int, or type instance. Fixes doctrine#4210
@@ -23,8 +23,8 @@ interface Statement extends ResultStatement | |||
* 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 ParameterType} | |||
* constants. | |||
* @param mixed $type Explicit data type for the parameter using the {@link ParameterType} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is invalid. All implementations of this interface must accept integers. A specific implementation (Doctrine\DBAL\Statement
) accepts other types but they are not part of the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @morozov - is the documentation incorrect then on Doctrine\DBAL\Connection::prepare
? FWIW changing the documentation on prepare
to return a Doctrine\DBAL\Statement
(and not a driver statement) fixes the issue for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's already fixed in 15d9be0 but not yet released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there plans to create a release in the near future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're waiting for #3980 to be resolved in order to release 2.10.3
, 2.11.0
, and 3.0.0
. We can release 2.10.3
earlier but there's no reason for that right now.
This change updates the documentation on the
bindValue
function. Per the implementation ofDBAL\Statement
this function can take a string, int, orType
instance.Fixes #4210
Summary
This change updates the documentation on the
bindValue
to fix problems with static analyzers. Since this doesn't appear to be a problem in 3.x versions of this library, I've only fixed the issue in 2.10.x.