1 | <?php namespace Cerbero\Auth\Pipes; |
||
11 | abstract class AbstractEventDispatcherPipe extends AbstractPipe { |
||
12 | |||
13 | /** |
||
14 | * @author Andrea Marco Sartori |
||
15 | * @var Illuminate\Contracts\Events\Dispatcher $dispatcher Event dispatcher. |
||
16 | */ |
||
17 | protected $dispatcher; |
||
18 | |||
19 | /** |
||
20 | * Set the dependencies. |
||
21 | * |
||
22 | * @author Andrea Marco Sartori |
||
23 | * @param Illuminate\Contracts\Container\Container $container |
||
24 | * @param Illuminate\Contracts\Events\Dispatcher $dispatcher |
||
25 | * @return void |
||
26 | */ |
||
27 | public function __construct(Container $container, Dispatcher $dispatcher) |
||
33 | |||
34 | /** |
||
35 | * Run before the job is handled. |
||
36 | * |
||
37 | * @param mixed $job |
||
38 | * @return mixed |
||
39 | */ |
||
40 | public function before($job) |
||
44 | |||
45 | /** |
||
46 | * Fire an event at some point. |
||
47 | * |
||
48 | * @author Andrea Marco Sartori |
||
49 | * @param string $action |
||
50 | * @param mixed $payload |
||
51 | * @return void |
||
52 | */ |
||
53 | private function fireEventOn($action, $payload) |
||
59 | |||
60 | /** |
||
61 | * Retrieve the event name. |
||
62 | * |
||
63 | * @author Andrea Marco Sartori |
||
64 | * @return string |
||
65 | */ |
||
66 | protected function getEventName() |
||
74 | |||
75 | /** |
||
76 | * Run after the handled job. |
||
77 | * |
||
78 | * @param mixed $handled |
||
79 | * @param mixed $job |
||
80 | * @return mixed |
||
81 | */ |
||
82 | public function after($handled, $job) |
||
86 | |||
87 | } |
||
88 |