Skip to content

Commit

Permalink
Inverting function names for internal closures in _bindParams as they
Browse files Browse the repository at this point in the history
make more sense now
  • Loading branch information
lorenzo committed Mar 7, 2013
1 parent 28d95c4 commit d44abb3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Cake/Model/Datasource/Database/Query.php
Expand Up @@ -1433,7 +1433,7 @@ protected function _conjugate($part, $append, $conjunction, $types) {
* @return void
*/
protected function _bindParams($statement) {
$visitor = function($expression) use ($statement) {
$binder = function($expression) use ($statement) {
$params = $types = [];

if ($expression instanceof Comparison) {
Expand All @@ -1450,10 +1450,10 @@ protected function _bindParams($statement) {
};

$refs = [];
$binder = function($expression, $name = null) use ($statement, $visitor, &$binder, &$refs) {
$visitor = function($expression, $name = null) use ($statement, &$visitor, $binder, &$refs) {
if (is_array($expression)) {
foreach ($expression as $e) {
$binder($e, $name);
$visitor($e, $name);
}
return;
}
Expand All @@ -1466,15 +1466,15 @@ protected function _bindParams($statement) {
}

$refs[$id] = 1;
$expression->traverse($binder);
$expression->traverse($visitor);

if (!($expression instanceof self)) {
$visitor($expression);
$binder($expression);
}
}
};

$this->_transformQuery()->traverse($binder);
$this->_transformQuery()->traverse($visitor);
}

/**
Expand Down

0 comments on commit d44abb3

Please sign in to comment.