Skip to content
Permalink
Browse files

Renaming a few methods, doc block improvements

  • Loading branch information...
burzum committed Jun 2, 2016
1 parent 2004d5a commit e3d5f6543e5071b43af5eac694c0774f2e7516dc
Showing with 18 additions and 18 deletions.
  1. +18 −18 src/Event/EventManager.php
@@ -54,18 +54,18 @@ class EventManager
protected $_isGlobal = false;
/**
* The event stack object.
* The event list object.
*
* @var \Cake\Event\EventList|null
*/
protected $_eventList;
/**
* Enables automatic adding of events to the event stack object if it is present.
* Enables automatic adding of events to the event list object if it is present.
*
* @param bool
*/
protected $_listEvents = false;
protected $_trackEvents = false;
/**
* Returns the globally available instance of a Cake\Event\EventManager
@@ -360,8 +360,8 @@ public function dispatch($event)
$listeners = $this->listeners($event->name());
if (empty($listeners)) {
if ($this->_listEvents) {
$this->listEvent($event);
if ($this->_trackEvents) {
$this->addEventToList($event);
}
return $event;
}
@@ -379,8 +379,8 @@ public function dispatch($event)
}
}
if ($this->_listEvents) {
$this->listEvent($event);
if ($this->_trackEvents) {
$this->addEventToList($event);
}
return $event;
}
@@ -492,50 +492,50 @@ public function getEventList()
}
/**
* Adds an event to the stack if the stack object is present.
* Adds an event to the list if the event list object is present.
*
* @param \Cake\Event\Event $event An event to add to the stack.
* @param \Cake\Event\Event $event An event to add to the list.
* @return void
*/
public function listEvent(Event $event)
public function addEventToList(Event $event)
{
if ($this->_eventList) {
$this->_eventList->add($event);
}
}
/**
* Enables / disables event stacking at runtime.
* Enables / disables event tracking at runtime.
*
* @param bool $enabled True or false to enable / disable it.
* @return void
*/
public function listEvents($enabled)
public function trackEvents($enabled)
{
$this->_listEvents = (bool)$enabled;
$this->_trackEvents = (bool)$enabled;
}
/**
* Enables the stacking of dispatched events.
* Enables the listing of dispatched events.
*
* @param \Cake\Event\EventList $eventList The event stack object to use.
* @param \Cake\Event\EventList $eventList The event list object to use.
* @return void
*/
public function setEventList(EventList $eventList)
{
$this->_eventList = $eventList;
$this->_listEvents = true;
$this->_trackEvents = true;
}
/**
* Disables the stacking of dispatched events.
* Disables the listing of dispatched events.
*
* @return void
*/
public function unsetEventList()
{
$this->_eventList = null;
$this->_listEvents = false;
$this->_trackEvents = false;
}
/**

0 comments on commit e3d5f65

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