Skip to content
Permalink
Browse files

Reverting coupling the decorator with the event manager

  • Loading branch information...
burzum committed May 18, 2016
1 parent c76c360 commit 907b24c4ed6ad7434db413e5ea1b2fb7e1dd8583
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/Event/EventManager.php
@@ -14,7 +14,6 @@
*/
namespace Cake\Event;
use Cake\Event\Decorator\ConditionDecorator;
use InvalidArgumentException;
/**
@@ -158,14 +157,14 @@ public function on($eventKey = null, $options = [], $callable = null)
$argCount = func_num_args();
if ($argCount === 2) {
$this->_listeners[$eventKey][static::$defaultPriority][] = [
'callable' => is_callable($options) ? new ConditionDecorator($options) : $options,
'callable' => $options
];
return;
}
if ($argCount === 3) {
$priority = isset($options['priority']) ? $options['priority'] : static::$defaultPriority;
$this->_listeners[$eventKey][$priority][] = [
'callable' => is_callable($callable) ? new ConditionDecorator($callable, $options) : $callable
'callable' => $callable
];
return;
}

0 comments on commit 907b24c

Please sign in to comment.
You can’t perform that action at this time.