Skip to content
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

Merged
merged 4 commits into from
Jul 15, 2016

Conversation

chrisguitarguy
Copy link
Contributor

So they get passed to the SQLLogger on Statement::execute.

Hopefully fixes #2440

So they get passed to the SQLLogger on `Statement::execute`.
$types = array($name => \PDO::PARAM_STR);
$sql = '';

$logger = $this->createMock('\Doctrine\DBAL\Logging\SQLLogger');
Copy link
Member

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())
Copy link
Member

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);
Copy link
Member

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.

@deeky666 deeky666 added this to the 2.5.5 milestone Jul 15, 2016
@deeky666 deeky666 self-assigned this Jul 15, 2016
@deeky666 deeky666 merged commit 5f4d92a into doctrine:master Jul 15, 2016
@deeky666
Copy link
Member

@chrisguitarguy thanks!

@deeky666
Copy link
Member

Backported to 2.5.

@chrisguitarguy chrisguitarguy deleted the fix_2440 branch July 15, 2016 17:26
@chrisguitarguy
Copy link
Contributor Author

No problem, @deeky666, glad to help.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No parameters passed to logger when executing statement using bindParam
3 participants