Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Argument 1 passed to ZendDeveloperTools\Listener\EventLoggingListenerAggregate::onCollectEvent() must be an instance of Zend\EventManager\Event #200

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Replace existing Zend\EventManager\Event type hints with Zend\EventMa…
…nager\EventInterface.
  • Loading branch information
alex-patterson-webdev committed Oct 31, 2015
commit a3af6912e6331341a9122d48b95b387c0b15ecd4
4 changes: 2 additions & 2 deletions src/ZendDeveloperTools/Collector/EventCollectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ZendDeveloperTools\Collector;

use Zend\EventManager\Event;
use Zend\EventManager\EventInterface;

/**
* Event Data Collector Interface.
Expand All @@ -23,5 +23,5 @@ interface EventCollectorInterface
* @param string $id
* @param Event $event
*/
public function collectEvent($id, Event $event);
public function collectEvent($id, EventInterface $event);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change can't be implemented until version 2.0.0 of the module, as it is a major BC break

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, it is a major mistake in designing this interface in first place :-(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no problem; I thought as much :-)

}
6 changes: 3 additions & 3 deletions src/ZendDeveloperTools/Collector/MemoryCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace ZendDeveloperTools\Collector;

use Zend\Mvc\MvcEvent;
use Zend\EventManager\Event;
use Zend\EventManager\EventInterface;
use ZendDeveloperTools\EventLogging\EventContextProvider;

/**
Expand Down Expand Up @@ -50,9 +50,9 @@ public function collect(MvcEvent $mvcEvent)
* Saves the current memory usage.
*
* @param string $id
* @param Event $event
* @param EventInterface $event
*/
public function collectEvent($id, Event $event)
public function collectEvent($id, EventInterface $event)
{
$contextProvider = new EventContextProvider($event);
$context['name'] = $contextProvider->getEvent()->getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ZendDeveloperTools\Listener;

use Zend\EventManager\Event;
use Zend\EventManager\EventInterface;
use Zend\EventManager\SharedEventManagerInterface;
use Zend\EventManager\SharedListenerAggregateInterface;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
Expand Down Expand Up @@ -75,13 +75,13 @@ public function detachShared(SharedEventManagerInterface $events)
/**
* Callback to process events
*
* @param Event $event
* @param EventInterface $event
*
* @return bool
*
* @throws ServiceNotFoundException
*/
public function onCollectEvent(Event $event)
public function onCollectEvent(EventInterface $event)
{
foreach ($this->collectors as $collector) {
$collector->collectEvent('application', $event);
Expand Down