-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5 A draft for the event handling mechanism.
- Loading branch information
automatix
committed
Apr 22, 2018
1 parent
afa21ec
commit db0e122
Showing
24 changed files
with
480 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
namespace App\Base\Enums; | ||
|
||
/** | ||
*/ | ||
abstract class AbstractProcessEventType extends AbstractEnum | ||
{ | ||
|
||
} |
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,9 @@ | ||
<?php | ||
namespace App\Base\Enums; | ||
|
||
/** | ||
*/ | ||
abstract class AbstractProcessState extends AbstractEnum | ||
{ | ||
|
||
} |
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,12 @@ | ||
<?php | ||
namespace App\Base\Enums; | ||
|
||
/** | ||
* @method static QuestState STARTED() | ||
*/ | ||
class PoiState extends AbstractProcessState | ||
{ | ||
|
||
const STARTED = 'started'; | ||
|
||
} |
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,20 @@ | ||
<?php | ||
namespace App\Base\Enums; | ||
|
||
/** | ||
* @method static QuestState STARTED() | ||
* @method static QuestState PLAYING() | ||
* @method static QuestState PAUSED() | ||
* @method static QuestState FINISHED() | ||
* @method static QuestState ENDED() | ||
*/ | ||
class QuestState extends AbstractProcessState | ||
{ | ||
|
||
const STARTED = 'started'; | ||
const PLAYING = 'playing'; | ||
const PAUSED = 'paused'; | ||
const FINISHED = 'finished'; | ||
const ENDED = 'ended'; | ||
|
||
} |
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,12 @@ | ||
<?php | ||
namespace App\Base\Enums; | ||
|
||
/** | ||
* @method static QuestState STARTED() | ||
*/ | ||
class StepState extends AbstractProcessState | ||
{ | ||
|
||
const STARTED = 'started'; | ||
|
||
} |
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,9 @@ | ||
<?php | ||
namespace App\Process; | ||
|
||
interface EventInStateHandlerInterface extends ResponsibleForEventInerface, StateHandlerInterface | ||
{ | ||
|
||
|
||
|
||
} |
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,12 @@ | ||
<?php | ||
namespace App\Process; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
interface EventListenerInterface | ||
{ | ||
|
||
function handle(Event $event, string $eventName, EventDispatcherInterface $eventDispatcher); | ||
|
||
} |
File renamed without changes.
File renamed without changes.
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class AccessFailedHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class AccessFailedHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventType, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class AccessProcessingHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class AccessProcessingHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventType, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class CompletedHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class CompletedHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventType, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
Empty file.
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class FinishedHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class FinishedHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventType, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class PlayingHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class PlayingHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventType, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class StartedHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class StartedHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventName, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class StartedHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class StartedHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventName, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php | ||
namespace App\Services\Process\Internal\Handlers\Quest; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\EventInStateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class StartedHandler implements EventInStateHandlerInterface | ||
* | ||
* @package App\Services\Process\Internal\Handlers\Quest | ||
* @author Ilya Khanataev <[email protected]> | ||
*/ | ||
class StartedHandler implements EventInStateHandlerInterface | ||
{ | ||
|
||
function isResponsibleFor(AbstractProcessEventType $processEvent) | ||
{ | ||
// TODO: Implement isResponsibleFor() method. | ||
} | ||
|
||
function handle( | ||
AbstractProcessState $processState, | ||
Event $event, | ||
string $eventType, | ||
EventDispatcherInterface $eventDispatcher | ||
) { | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,18 @@ | ||
<?php | ||
namespace App\Process\Listeners; | ||
|
||
use App\Base\Enums\AbstractProcessEventType; | ||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\StateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
class PoiHandler implements StateHandlerInterface | ||
{ | ||
|
||
public function handle(AbstractProcessState $processState, Event $event, AbstractProcessEventType $eventType, EventDispatcherInterface $eventDispatcher) | ||
{ | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
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,17 @@ | ||
<?php | ||
namespace App\Process\Listeners; | ||
|
||
use App\Base\Enums\AbstractProcessState; | ||
use App\Process\StateHandlerInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
|
||
class QuestHandler implements StateHandlerInterface | ||
{ | ||
|
||
public function handle(AbstractProcessState $processState, Event $event, string $eventType, EventDispatcherInterface $eventDispatcher) | ||
{ | ||
// TODO: Implement handle() method. | ||
} | ||
|
||
} |
Oops, something went wrong.