From 8282c660c94c3b24487a45962934ccd20c91cecb Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 27 Oct 2013 15:21:37 -0400 Subject: [PATCH] Fix code review feedback. --- Cake/ORM/Behavior.php | 5 ++--- Cake/ORM/BehaviorRegistry.php | 11 ++++++++--- Cake/ORM/Table.php | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cake/ORM/Behavior.php b/Cake/ORM/Behavior.php index a6319f397a9..cc18801ea41 100644 --- a/Cake/ORM/Behavior.php +++ b/Cake/ORM/Behavior.php @@ -19,8 +19,7 @@ /** * Base class for behaviors. * - * Defines the Behavior interface, and contains common model interaction - * functionality. Behaviors allow you to simulate mixins, and create + * Behaviors allow you to simulate mixins, and create * reusable blocks of application logic, that can be reused across * several models. Behaviors also provide a way to hook into model * callbacks and augment their behavior. @@ -37,7 +36,7 @@ * } * }}} * - * Would be called like `$this->Table->doSomething($arg1, $arg2);`. + * Would be called like `$table->doSomething($arg1, $arg2);`. * * ## Callback methods * diff --git a/Cake/ORM/BehaviorRegistry.php b/Cake/ORM/BehaviorRegistry.php index 890ca2796da..6e377a312bd 100644 --- a/Cake/ORM/BehaviorRegistry.php +++ b/Cake/ORM/BehaviorRegistry.php @@ -105,7 +105,7 @@ protected function _throwMissingClassError($class, $plugin) { * @param string $class The classname that is missing. * @param string $alias The alias of the object. * @param array $settings An array of settings to use for the behavior. - * @return Component The constructed behavior class. + * @return Behavior The constructed behavior class. */ protected function _create($class, $alias, $settings) { $instance = new $class($this->_table, $settings); @@ -140,8 +140,13 @@ protected function _mapMethods(Behavior $instance, $class, $alias) { foreach ($methods as $method) { $isFinder = substr($method, 0, 4) === 'find'; if (($isFinder && isset($this->_finderMap[$method])) || isset($this->_methodMap[$method])) { - $message = '%s contains duplicate method "%s" which is already provided by %s'; - $error = __d('cake_dev', $message, $class, $method, $this->_methodMap[$method]); + $error = __d( + 'cake_dev', + '%s contains duplicate method "%s" which is already provided by %s', + $class, + $method, + $this->_methodMap[$method] + ); throw new Error\Exception($error); } if ($isFinder) { diff --git a/Cake/ORM/Table.php b/Cake/ORM/Table.php index 651fe855721..e95bd6f4532 100644 --- a/Cake/ORM/Table.php +++ b/Cake/ORM/Table.php @@ -392,7 +392,7 @@ public function entityClass($name = null) { * * @param string $name The name of the behavior. Can be a short class reference. * @param array $options The options for the behavior to use. - * @return null + * @return void * @see Cake\ORM\Behavior */ public function addBehavior($name, $options = []) {