Initial Drupal 11 with DDEV setup
This commit is contained in:
29
vendor/consolidation/annotated-command/src/Events/CustomEventAwareTrait.php
vendored
Normal file
29
vendor/consolidation/annotated-command/src/Events/CustomEventAwareTrait.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace Consolidation\AnnotatedCommand\Events;
|
||||
|
||||
use Consolidation\AnnotatedCommand\Hooks\HookManager;
|
||||
|
||||
trait CustomEventAwareTrait
|
||||
{
|
||||
/** var HookManager */
|
||||
protected $hookManager;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setHookManager(HookManager $hookManager)
|
||||
{
|
||||
$this->hookManager = $hookManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getCustomEventHandlers($eventName)
|
||||
{
|
||||
if (!$this->hookManager) {
|
||||
return [];
|
||||
}
|
||||
return $this->hookManager->getHook($eventName, HookManager::ON_EVENT);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user