-
-
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
Track the Values & Types Passed to Statement::bindParam #2443
Conversation
So they get passed to the SQLLogger on `Statement::execute`.
$types = array($name => \PDO::PARAM_STR); | ||
$sql = ''; | ||
|
||
$logger = $this->createMock('\Doctrine\DBAL\Logging\SQLLogger'); |
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.
can use ::class
here
->method('startQuery') | ||
->with(self::equalTo($sql), self::equalTo($values), self::equalTo($types)); | ||
|
||
$this->configuration->expects($this->once()) |
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.
self::once()
@@ -138,6 +138,8 @@ public function bindValue($name, $value, $type = null) | |||
*/ | |||
public function bindParam($name, &$var, $type = PDO::PARAM_STR, $length = null) | |||
{ | |||
$this->params[$name] = $var; | |||
$this->types[$name] = $type; | |||
return $this->stmt->bindParam($name, $var, $type, $length); |
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.
Can you please add a newline before the return
statement? Otherwise patch looks good to me.
@chrisguitarguy thanks! |
Backported to |
No problem, @deeky666, glad to help. |
So they get passed to the SQLLogger on
Statement::execute
.Hopefully fixes #2440