From daf73ef7c6dac15b61da1450c484a61c3b94b6fc Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 30 Oct 2014 10:14:05 -0400 Subject: [PATCH] Make method name better represent what it is going to do. Refs #5002 --- src/Core/ConventionsTrait.php | 2 +- src/Shell/Task/ControllerTask.php | 4 ++-- src/Template/Bake/default/actions/controller_actions.ctp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/ConventionsTrait.php b/src/Core/ConventionsTrait.php index c3c627444b3..15d15908406 100644 --- a/src/Core/ConventionsTrait.php +++ b/src/Core/ConventionsTrait.php @@ -80,7 +80,7 @@ protected function _singularName($name) { * @param string $name Name to use * @return string Plural name for views */ - protected function _pluralName($name) { + protected function _variableName($name) { return Inflector::variable($name); } diff --git a/src/Shell/Task/ControllerTask.php b/src/Shell/Task/ControllerTask.php index 432faef6ed3..e79c82cddef 100644 --- a/src/Shell/Task/ControllerTask.php +++ b/src/Shell/Task/ControllerTask.php @@ -90,10 +90,10 @@ public function bakeActions($controllerName) { $modelObj = TableRegistry::get($currentModelName); - $pluralName = $this->_pluralName($currentModelName); + $pluralName = $this->_variableName($currentModelName); $singularName = $this->_singularName($currentModelName); $singularHumanName = $this->_singularHumanName($controllerName); - $pluralHumanName = $this->_pluralName($controllerName); + $pluralHumanName = $this->_variableName($controllerName); $this->Template->set(compact( 'plugin', 'admin', 'pluralName', 'singularName', diff --git a/src/Template/Bake/default/actions/controller_actions.ctp b/src/Template/Bake/default/actions/controller_actions.ctp index 960886adbf5..669b720d414 100644 --- a/src/Template/Bake/default/actions/controller_actions.ctp +++ b/src/Template/Bake/default/actions/controller_actions.ctp @@ -82,7 +82,7 @@ $allAssociations = array_merge( foreach ($editAssociations as $assoc): $association = $modelObj->association($assoc); $otherName = $association->target()->alias(); - $otherPlural = $this->_pluralName($otherName); + $otherPlural = $this->_variableName($otherName); echo "\t\t\${$otherPlural} = \$this->{$currentModelName}->{$otherName}->find('list');\n"; $compact[] = "'{$otherPlural}'"; endforeach; @@ -115,7 +115,7 @@ $allAssociations = array_merge( foreach ($editAssociations as $assoc): $association = $modelObj->association($assoc); $otherName = $association->target()->alias(); - $otherPlural = $this->_pluralName($otherName); + $otherPlural = $this->_variableName($otherName); echo "\t\t\${$otherPlural} = \$this->{$currentModelName}->{$otherName}->find('list');\n"; $compact[] = "'{$otherPlural}'"; endforeach;