Skip to content

Commit

Permalink
[zen-27] Renamed interfaces in Zend\EventManager
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Apr 21, 2012
1 parent 52120c3 commit a9608b2
Show file tree
Hide file tree
Showing 51 changed files with 196 additions and 193 deletions.
10 changes: 5 additions & 5 deletions library/Zend/Cache/Storage/Plugin/ClearByFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace Zend\Cache\Storage\Plugin;

use Traversable,
Zend\EventManager\EventCollection,
Zend\EventManager\EventManagerInterface,
Zend\Cache\Exception,
Zend\Cache\Storage\Adapter,
Zend\Cache\Storage\PostEvent;
Expand All @@ -46,11 +46,11 @@ class ClearByFactor extends AbstractPlugin
/**
* Attach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return ClearByFactor
* @throws Exception\LogicException
*/
public function attach(EventCollection $eventCollection)
public function attach(EventManagerInterface $eventCollection)
{
$index = spl_object_hash($eventCollection);
if (isset($this->handles[$index])) {
Expand All @@ -71,11 +71,11 @@ public function attach(EventCollection $eventCollection)
/**
* Detach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return ClearByFactor
* @throws Exception\LogicException
*/
public function detach(EventCollection $eventCollection)
public function detach(EventManagerInterface $eventCollection)
{
$index = spl_object_hash($eventCollection);
if (!isset($this->handles[$index])) {
Expand Down
10 changes: 5 additions & 5 deletions library/Zend/Cache/Storage/Plugin/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Traversable,
Zend\Cache\Exception,
Zend\Cache\Storage\ExceptionEvent,
Zend\EventManager\EventCollection;
Zend\EventManager\EventManagerInterface;

/**
* @category Zend
Expand All @@ -44,11 +44,11 @@ class ExceptionHandler extends AbstractPlugin
/**
* Attach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return ExceptionHandler
* @throws Exception\LogicException
*/
public function attach(EventCollection $eventCollection)
public function attach(EventManagerInterface $eventCollection)
{
$index = spl_object_hash($eventCollection);
if (isset($this->handles[$index])) {
Expand Down Expand Up @@ -115,11 +115,11 @@ public function attach(EventCollection $eventCollection)
/**
* Detach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return ExceptionHandler
* @throws Exception\LogicException
*/
public function detach(EventCollection $eventCollection)
public function detach(EventManagerInterface $eventCollection)
{
$index = spl_object_hash($eventCollection);
if (!isset($this->handles[$index])) {
Expand Down
10 changes: 5 additions & 5 deletions library/Zend/Cache/Storage/Plugin/IgnoreUserAbort.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Zend\Cache\Exception,
Zend\Cache\Storage\Adapter,
Zend\Cache\Storage\Event,
Zend\EventManager\EventCollection;
Zend\EventManager\EventManagerInterface;

/**
* @category Zend
Expand Down Expand Up @@ -52,11 +52,11 @@ class IgnoreUserAbort extends AbstractPlugin
/**
* Attach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return Serializer
* @throws Exception\LogicException
*/
public function attach(EventCollection $events)
public function attach(EventManagerInterface $events)
{
$index = spl_object_hash($events);
if (isset($this->handles[$index])) {
Expand Down Expand Up @@ -120,11 +120,11 @@ public function attach(EventCollection $events)
/**
* Detach
*
* @param EventCollection $events
* @param EventManagerInterface $events
* @return Serializer
* @throws Exception\LogicException
*/
public function detach(EventCollection $events)
public function detach(EventManagerInterface $events)
{
$index = spl_object_hash($events);
if (!isset($this->handles[$index])) {
Expand Down
10 changes: 5 additions & 5 deletions library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Traversable,
Zend\Cache\Exception,
Zend\Cache\Storage\PostEvent,
Zend\EventManager\EventCollection;
Zend\EventManager\EventManagerInterface;

/**
* @category Zend
Expand All @@ -45,11 +45,11 @@ class OptimizeByFactor extends AbstractPlugin
/**
* Attach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return OptimizeByFactor
* @throws Exception\LogicException
*/
public function attach(EventCollection $eventCollection)
public function attach(EventManagerInterface $eventCollection)
{
$index = spl_object_hash($eventCollection);
if (isset($this->handles[$index])) {
Expand All @@ -70,11 +70,11 @@ public function attach(EventCollection $eventCollection)
/**
* Detach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return OptimizeByFactor
* @throws Exception\LogicException
*/
public function detach(EventCollection $eventCollection)
public function detach(EventManagerInterface $eventCollection)
{
$index = spl_object_hash($eventCollection);
if (!isset($this->handles[$index])) {
Expand Down
10 changes: 5 additions & 5 deletions library/Zend/Cache/Storage/Plugin/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Zend\Cache\Storage\Capabilities,
Zend\Cache\Storage\Event,
Zend\Cache\Storage\PostEvent,
Zend\EventManager\EventCollection;
Zend\EventManager\EventManagerInterface;

/**
* @category Zend
Expand All @@ -53,11 +53,11 @@ class Serializer extends AbstractPlugin
/**
* Attach
*
* @param EventCollection $eventCollection
* @param EventManagerInterface $eventCollection
* @return Serializer
* @throws Exception\LogicException
*/
public function attach(EventCollection $events)
public function attach(EventManagerInterface $events)
{
$index = spl_object_hash($events);
if (isset($this->handles[$index])) {
Expand Down Expand Up @@ -103,11 +103,11 @@ public function attach(EventCollection $events)
/**
* Detach
*
* @param EventCollection $events
* @param EventManagerInterface $events
* @return Serializer
* @throws Exception\LogicException
*/
public function detach(EventCollection $events)
public function detach(EventManagerInterface $events)
{
$index = spl_object_hash($events);
if (!isset($this->handles[$index])) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/EventManager/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Event implements EventDescription
class Event implements EventInterface
{
/**
* @var string Event name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface EventDescription
interface EventInterface
{
/**
* Get event name
Expand Down Expand Up @@ -94,7 +94,7 @@ public function setParams($params);
public function setParam($name, $value);

/**
* Indicate whether or not the parent EventCollection should stop propagating events
* Indicate whether or not the parent EventManagerInterface should stop propagating events
*
* @param bool $flag
* @return void
Expand Down
34 changes: 17 additions & 17 deletions library/Zend/EventManager/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class EventManager implements EventCollection, SharedEventCollectionAware
class EventManager implements EventManagerInterface, SharedEventManagerAwareInterface
{
/**
* Subscribed events and their listeners
Expand All @@ -52,22 +52,22 @@ class EventManager implements EventCollection, SharedEventCollectionAware
protected $eventClass = 'Zend\EventManager\Event';

/**
* Identifiers, used to pull shared signals from SharedEventCollection instance
* Identifiers, used to pull shared signals from SharedEventManagerInterface instance
* @var array
*/
protected $identifiers = array();

/**
* Shared connections
* @var false|null|SharedEventCollection
* @var false|null|SharedEventManagerInterface
*/
protected $sharedCollections = null;

/**
* Constructor
*
* Allows optionally specifying identifier(s) to use to pull signals from a
* SharedEventCollection.
* SharedEventManagerInterface.
*
* @param null|string|int|array|Traversable $identifiers
* @return void
Expand All @@ -92,10 +92,10 @@ public function setEventClass($class)
/**
* Set shared collections container
*
* @param SharedEventCollection $connections
* @param SharedEventManagerInterface $connections
* @return void
*/
public function setSharedCollections(SharedEventCollection $sharedEventCollection)
public function setSharedCollections(SharedEventManagerInterface $sharedEventCollection)
{
$this->sharedCollections = $sharedEventCollection;
return $this;
Expand All @@ -114,7 +114,7 @@ public function unsetSharedCollections()
/**
* Get shared collections container
*
* @return false|SharedEventCollection
* @return false|SharedEventManagerInterface
*/
public function getSharedCollections()
{
Expand Down Expand Up @@ -179,15 +179,15 @@ public function addIdentifiers($identifiers)
*/
public function trigger($event, $target = null, $argv = array(), $callback = null)
{
if ($event instanceof EventDescription) {
if ($event instanceof EventInterface) {
$e = $event;
$event = $e->getName();
$callback = $target;
} elseif ($target instanceof EventDescription) {
} elseif ($target instanceof EventInterface) {
$e = $target;
$e->setName($event);
$callback = $argv;
} elseif ($argv instanceof EventDescription) {
} elseif ($argv instanceof EventInterface) {
$e = $argv;
$e->setName($event);
$e->setTarget($target);
Expand Down Expand Up @@ -220,15 +220,15 @@ public function trigger($event, $target = null, $argv = array(), $callback = nul
*/
public function triggerUntil($event, $target, $argv = null, $callback = null)
{
if ($event instanceof EventDescription) {
if ($event instanceof EventInterface) {
$e = $event;
$event = $e->getName();
$callback = $target;
} elseif ($target instanceof EventDescription) {
} elseif ($target instanceof EventInterface) {
$e = $target;
$e->setName($event);
$callback = $argv;
} elseif ($argv instanceof EventDescription) {
} elseif ($argv instanceof EventInterface) {
$e = $argv;
$e->setName($event);
$e->setTarget($target);
Expand Down Expand Up @@ -305,7 +305,7 @@ public function attach($event, $callback = null, $priority = 1)
/**
* Attach a listener aggregate
*
* Listener aggregates accept an EventCollection instance, and call attach()
* Listener aggregates accept an EventManagerInterface instance, and call attach()
* one or more times, typically to attach to multiple events using local
* methods.
*
Expand Down Expand Up @@ -356,7 +356,7 @@ public function detach($listener)
/**
* Detach a listener aggregate
*
* Listener aggregates accept an EventCollection instance, and call detach()
* Listener aggregates accept an EventManagerInterface instance, and call detach()
* of all previously attached listeners.
*
* @param ListenerAggregate $aggregate
Expand Down Expand Up @@ -426,11 +426,11 @@ public function prepareArgs(array $args)
* delegate.
*
* @param string $event Event name
* @param EventDescription $e
* @param EventInterface $e
* @param null|callback $callback
* @return ResponseCollection
*/
protected function triggerListeners($event, EventDescription $e, $callback = null)
protected function triggerListeners($event, EventInterface $e, $callback = null)
{
$responses = new ResponseCollection;
$listeners = $this->getListeners($event);
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/EventManager/EventManagerAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ interface EventManagerAware
/**
* Inject an EventManager instance
*
* @param EventCollection $eventManager
* @param EventManagerInterface $eventManager
* @return void
*/
public function setEventManager(EventCollection $eventManager);
public function setEventManager(EventManagerInterface $eventManager);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface EventCollection
interface EventManagerInterface
{
/**
* Trigger an event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\EventManager;
namespace Zend\EventManager\Exception;

/**
* Base exception interface
Expand All @@ -28,6 +28,6 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception
interface ExceptionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

namespace Zend\EventManager\Exception;

use Zend\EventManager\Exception;

/**
* Invalid argument exception
*
Expand All @@ -31,6 +29,6 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class InvalidArgumentException
extends \InvalidArgumentException implements Exception
extends \InvalidArgumentException implements ExceptionInterface
{
}
Loading

0 comments on commit a9608b2

Please sign in to comment.