You are here

public function AcsfEvent::popHandler in Acquia Cloud Site Factory Connector 8.2

Same name and namespace in other branches
  1. 8 src/Event/AcsfEvent.php \Drupal\acsf\Event\AcsfEvent::popHandler()

Pops (actually shifts to preserve order) a handler from the internal list.

Parameters

string $type: The type of handler: incomplete, complete or failed.

Return value

AcsfEventHandler The next event handler.

Throws

\Drupal\acsf\Event\AcsfEventHandlerIncompatibleException

File

src/Event/AcsfEvent.php, line 154

Class

AcsfEvent
ACSF Event.

Namespace

Drupal\acsf\Event

Code

public function popHandler($type = 'incomplete') {
  if (array_key_exists($type, $this->handlers)) {
    return array_shift($this->handlers[$type]);
  }
  else {
    throw new AcsfEventHandlerIncompatibleException(sprintf('The handler type "%s" is incompatible with this event.', $type));
  }
}