-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from pantheon-systems/CMS-388
CMS-388 - Drupal 8 compatibility
- Loading branch information
Showing
3 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Drupal\search_api_pantheon\Events; | ||
|
||
use Psr\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\EventDispatcher\EventDispatcher as SymfonyEventDispatcher; | ||
|
||
/** | ||
* Pantheon Event Dispatcher. | ||
*/ | ||
class PantheonEventDispatcher extends SymfonyEventDispatcher implements EventDispatcherInterface { | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $listeners = []; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $sorted = []; | ||
|
||
/** | ||
* Override to fix issues with zero listeners. | ||
* | ||
* @param null $eventName | ||
* Name of the Event in question. | ||
* | ||
* @return array|mixed | ||
* Any listeners or empty array. | ||
*/ | ||
public function getListeners($eventName = NULL) { | ||
if (empty($this->listeners)) { | ||
return []; | ||
} | ||
|
||
return parent::getListeners( | ||
$eventName | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters