Skip to content

Commit

Permalink
don't pass by reference
Browse files Browse the repository at this point in the history
it confuses the noobs
  • Loading branch information
AD7six committed Nov 10, 2013
1 parent 434344c commit 72eaf89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Cake/ORM/BehaviorRegistry.php
Expand Up @@ -134,7 +134,7 @@ protected function _getMethods(Behavior $instance, $class, $alias) {
$finders = array_change_key_case($instance->implementedFinders());
$methods = array_change_key_case($instance->implementedMethods());

foreach($finders as $finder => &$methodName) {
foreach($finders as $finder => $methodName) {
if (isset($this->_finderMap[$finder])) {
$duplicate = $this->_finderMap[$finder];
$error = __d(
Expand All @@ -146,10 +146,10 @@ protected function _getMethods(Behavior $instance, $class, $alias) {
);
throw new Error\Exception($error);
}
$methodName = [$alias, $methodName];
$finders[$finder] = [$alias, $methodName];
}

foreach($methods as $method => &$methodName) {
foreach($methods as $method => $methodName) {
if (isset($this->_methodMap[$method])) {
$duplicate = $this->_methodMap[$method];
$error = __d(
Expand All @@ -161,7 +161,7 @@ protected function _getMethods(Behavior $instance, $class, $alias) {
);
throw new Error\Exception($error);
}
$methodName = [$alias, $methodName];
$methods[$method] = [$alias, $methodName];
}

return compact('methods', 'finders');
Expand Down

0 comments on commit 72eaf89

Please sign in to comment.