Skip to content

Commit

Permalink
#5 restructuring Listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
automatix committed Apr 24, 2018
1 parent 7705bb6 commit 5432341
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
Empty file.
22 changes: 0 additions & 22 deletions src/Process/Listeners/PoiHandler.php

This file was deleted.

23 changes: 23 additions & 0 deletions src/Process/Listeners/PoiListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
namespace App\Process\Listeners;

use App\Base\Enums\Processes\EventNames\AbstractEventName;
use App\Base\Enums\Processes\States\AbstractProcessState;
use App\Process\StateHandlerInterface;
use App\Services\Process\Internal\StateHandlers\Quest\AccessFailedHandler;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class PoiListener extends AbstractProcessListener
{

const RELEVANT_STATE_HANDLER_NAMESPACE = '\App\Services\Process\Internal\StateHandlers\Poi';

public function handle(Event $event, AbstractEventName $eventName, EventDispatcherInterface $eventDispatcher)
{
$currentPoiState = $this->getStateManagingService()->detectPoiState();
$concreteHandler = $this->buildConcreteHandler($currentPoiState, $eventName);
call_user_func($concreteHandler, $event, $eventName, $eventDispatcher);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class QuestHandler implements StateHandlerInterface
class QuestListener extends AbstractProcessListener
{

public function handle(AbstractProcessState $processState, Event $event, AbstractEventName $eventName, EventDispatcherInterface $eventDispatcher)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class StepHandler implements StateHandlerInterface
class StepListener extends AbstractProcessListener
{

/** @var EventInStateHandlerInterface[] */
Expand Down

0 comments on commit 5432341

Please sign in to comment.