1 | <?php |
||
16 | class MarshalDispatcher implements DispatcherInterface |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @author Andrea Marco Sartori |
||
21 | * @var Illuminate\Contracts\Bus\Dispatcher $dispatcher Bus dispatcher. |
||
22 | */ |
||
23 | protected $dispatcher; |
||
24 | |||
25 | /** |
||
26 | * @author Andrea Marco Sartori |
||
27 | * @var string $command Command to dispatch |
||
28 | */ |
||
29 | protected $command; |
||
30 | |||
31 | /** |
||
32 | * @author Andrea Marco Sartori |
||
33 | * @var \ArrayAccess $values Parameters values |
||
34 | */ |
||
35 | protected $values; |
||
36 | |||
37 | /** |
||
38 | * Set the dependencies. |
||
39 | * |
||
40 | * @author Andrea Marco Sartori |
||
41 | * @param Illuminate\Contracts\Bus\Dispatcher $dispatcher |
||
42 | * @return void |
||
|
|||
43 | */ |
||
44 | public function __construct(Dispatcher $dispatcher) |
||
48 | |||
49 | /** |
||
50 | * Set the pipes commands should be piped through before dispatching. |
||
51 | * |
||
52 | * @author Andrea Marco Sartori |
||
53 | * @param array $pipes |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function pipeThrough(array $pipes) |
||
62 | |||
63 | /** |
||
64 | * Marshal a command and dispatch it. |
||
65 | * |
||
66 | * @author Andrea Marco Sartori |
||
67 | * @param mixed $command |
||
68 | * @param \ArrayAccess $source |
||
69 | * @param array $extras |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function dispatchFrom($command, ArrayAccess $source, array $extras = []) |
||
80 | |||
81 | /** |
||
82 | * Marshal the command to dispatch. |
||
83 | * |
||
84 | * @author Andrea Marco Sartori |
||
85 | * @return mixed |
||
86 | */ |
||
87 | protected function marshal() |
||
97 | |||
98 | /** |
||
99 | * Retrieve the arguments to inject into the command constructor. |
||
100 | * |
||
101 | * @author Andrea Marco Sartori |
||
102 | * @param array $parameters |
||
103 | * @return array |
||
104 | */ |
||
105 | protected function getParamsToInject(array $parameters) |
||
113 | |||
114 | /** |
||
115 | * Get a parameter value for a marshaled command. |
||
116 | * |
||
117 | * @author Andrea Marco Sartori |
||
118 | * @param \ReflectionParameter $parameter |
||
119 | * @return mixed |
||
120 | */ |
||
121 | protected function grabParameter(ReflectionParameter $parameter) |
||
135 | |||
136 | } |
||
137 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.