Skip to content

Commit

Permalink
Fix code review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 27, 2013
1 parent 221cd8c commit 8282c66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Cake/ORM/Behavior.php
Expand Up @@ -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.
Expand All @@ -37,7 +36,7 @@
* }
* }}}
*
* Would be called like `$this->Table->doSomething($arg1, $arg2);`.
* Would be called like `$table->doSomething($arg1, $arg2);`.
*
* ## Callback methods
*
Expand Down
11 changes: 8 additions & 3 deletions Cake/ORM/BehaviorRegistry.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Cake/ORM/Table.php
Expand Up @@ -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 = []) {
Expand Down

0 comments on commit 8282c66

Please sign in to comment.