Skip to content

Commit

Permalink
Renamed EventManagerTrait to EventDispatcherTrait to better reflect t…
Browse files Browse the repository at this point in the history
…hat it implements EventDispatcherInterface.
  • Loading branch information
robertpustulka committed Jul 21, 2015
1 parent 742f85d commit defeff0
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions config/bootstrap.php
Expand Up @@ -21,6 +21,7 @@
if (PHP_VERSION_ID < 70000) {
class_alias('Cake\Utility\Text', 'Cake\Utility\String');
}
class_alias('Cake\Event\EventDispatcherTrait', 'Cake\Event\EventManagerTrait');

require CAKE . 'basics.php';

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Component/AuthComponent.php
Expand Up @@ -19,7 +19,7 @@
use Cake\Core\App;
use Cake\Core\Exception\Exception;
use Cake\Event\Event;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\Network\Exception\ForbiddenException;
use Cake\Network\Request;
use Cake\Network\Response;
Expand All @@ -36,7 +36,7 @@
class AuthComponent extends Component
{

use EventManagerTrait;
use EventDispatcherTrait;

/**
* Constant for 'all'
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/ComponentRegistry.php
Expand Up @@ -18,7 +18,7 @@
use Cake\Core\App;
use Cake\Core\ObjectRegistry;
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;

/**
* ComponentRegistry is a registry for loaded components
Expand All @@ -28,7 +28,7 @@
class ComponentRegistry extends ObjectRegistry implements EventDispatcherInterface
{

use EventManagerTrait;
use EventDispatcherTrait;

/**
* The controller that this collection was initialized with.
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Controller.php
Expand Up @@ -19,7 +19,7 @@
use Cake\Event\Event;
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventListenerInterface;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\Log\LogTrait;
use Cake\Network\Request;
use Cake\Network\Response;
Expand Down Expand Up @@ -84,7 +84,7 @@
class Controller implements EventListenerInterface, EventDispatcherInterface
{

use EventManagerTrait;
use EventDispatcherTrait;
use LogTrait;
use MergeVariablesTrait;
use ModelAwareTrait;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/ObjectRegistry.php
Expand Up @@ -28,7 +28,7 @@
* the template method load().
*
* The ObjectRegistry is EventManager aware, but each extending class will need to use
* \Cake\Event\EventManagerTrait to attach and detach on set and bind
* \Cake\Event\EventDispatcherTrait to attach and detach on set and bind
*
* @see \Cake\Controller\ComponentRegistry
* @see \Cake\View\HelperRegistry
Expand Down
2 changes: 1 addition & 1 deletion src/Event/EventDispatcherInterface.php
Expand Up @@ -22,7 +22,7 @@
* Objects with this interface can trigger events, and have
* an event manager retrieved from them.
*
* The Cake\Event\EventManagerTrait lets you easily implement
* The Cake\Event\EventDispatcherTrait lets you easily implement
* this interface.
*/
interface EventDispatcherInterface
Expand Down
Expand Up @@ -18,7 +18,7 @@
* Provides the event manager interface features for usage in classes that require it.
*
*/
trait EventManagerTrait
trait EventDispatcherTrait
{

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Event/README.md
Expand Up @@ -13,12 +13,12 @@ of the action.

```php
use Cake\Event\Event;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;

class Orders
{

use EventManagerTrait;
use EventDispatcherTrait;

public function placeOrder($order)
{
Expand Down
4 changes: 2 additions & 2 deletions src/ORM/BehaviorRegistry.php
Expand Up @@ -18,7 +18,7 @@
use Cake\Core\App;
use Cake\Core\ObjectRegistry;
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\ORM\Behavior;
use Cake\ORM\Exception\MissingBehaviorException;
use Cake\ORM\Table;
Expand All @@ -33,7 +33,7 @@
class BehaviorRegistry extends ObjectRegistry implements EventDispatcherInterface
{

use EventManagerTrait;
use EventDispatcherTrait;

/**
* The table using this registry.
Expand Down
4 changes: 2 additions & 2 deletions src/ORM/Table.php
Expand Up @@ -27,7 +27,7 @@
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventListenerInterface;
use Cake\Event\EventManager;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\ORM\AssociationCollection;
use Cake\ORM\Association\BelongsTo;
use Cake\ORM\Association\BelongsToMany;
Expand Down Expand Up @@ -122,7 +122,7 @@
class Table implements RepositoryInterface, EventListenerInterface, EventDispatcherInterface
{

use EventManagerTrait;
use EventDispatcherTrait;
use RulesAwareTrait;
use ValidatorAwareTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/Routing/Dispatcher.php
Expand Up @@ -16,7 +16,7 @@

use Cake\Controller\Controller;
use Cake\Event\EventListenerInterface;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Routing\Exception\MissingControllerException;
Expand All @@ -31,7 +31,7 @@
class Dispatcher
{

use EventManagerTrait;
use EventDispatcherTrait;

/**
* Connected filter objects
Expand Down
4 changes: 2 additions & 2 deletions src/View/Cell.php
Expand Up @@ -16,7 +16,7 @@

use Cake\Datasource\ModelAwareTrait;
use Cake\Event\EventManager;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Utility\Inflector;
Expand All @@ -31,7 +31,7 @@
abstract class Cell
{

use EventManagerTrait;
use EventDispatcherTrait;
use ModelAwareTrait;
use ViewVarsTrait;

Expand Down
4 changes: 2 additions & 2 deletions src/View/HelperRegistry.php
Expand Up @@ -17,7 +17,7 @@
use Cake\Core\App;
use Cake\Core\ObjectRegistry;
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\View\View;

/**
Expand All @@ -27,7 +27,7 @@
class HelperRegistry extends ObjectRegistry implements EventDispatcherInterface
{

use EventManagerTrait;
use EventDispatcherTrait;

/**
* View object to use when making helpers.
Expand Down
4 changes: 2 additions & 2 deletions src/View/View.php
Expand Up @@ -19,7 +19,7 @@
use Cake\Core\Plugin;
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventManager;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\Log\LogTrait;
use Cake\Network\Request;
use Cake\Network\Response;
Expand Down Expand Up @@ -62,7 +62,7 @@ class View implements EventDispatcherInterface
{

use CellTrait;
use EventManagerTrait;
use EventDispatcherTrait;
use LogTrait;
use RequestActionTrait;
use ViewVarsTrait;
Expand Down
Expand Up @@ -15,14 +15,14 @@
namespace Cake\Test\TestCase\Event;

use Cake\Event\EventManager;
use Cake\Event\EventManagerTrait;
use Cake\Event\EventDispatcherTrait;
use Cake\TestSuite\TestCase;

/**
* EventManagerTrait test case
* EventDispatcherTrait test case
*
*/
class EventManagerTraitTest extends TestCase
class EventDispatcherTraitTest extends TestCase
{

/**
Expand All @@ -34,7 +34,7 @@ public function setUp()
{
parent::setUp();

$this->subject = $this->getObjectForTrait('Cake\Event\EventManagerTrait');
$this->subject = $this->getObjectForTrait('Cake\Event\EventDispatcherTrait');
}

/**
Expand All @@ -50,7 +50,7 @@ public function testIsInitiallyEmpty()
/**
* testSettingEventManager
*
* @covers \Cake\Event\EventManagerTrait::eventManager
* @covers \Cake\Event\EventDispatcherTrait::eventManager
* @return void
*/
public function testSettingEventManager()
Expand Down

0 comments on commit defeff0

Please sign in to comment.