Skip to content

Commit

Permalink
use array_fill_keys instead of a manual loop
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Nov 4, 2013
1 parent 1312bde commit 902f3eb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Cake/Model/Behavior/TimestampBehavior.php
Expand Up @@ -104,11 +104,7 @@ public function handleEvent(Event $event, Entity $entity) {
* @return array
*/
public function implementedEvents() {
$events = array_flip(array_keys($this->_settings['events']));
foreach ($events as &$method) {
$method = 'handleEvent';
}
return $events;
return array_fill_keys(array_keys($this->_settings['events']), 'handleEvent');
}

/**
Expand Down

0 comments on commit 902f3eb

Please sign in to comment.