@@ -33,7 +33,9 @@ class PheanstalkProxy implements PheanstalkProxyInterface
33
33
*/
34
34
protected $ pheanstalk ;
35
35
36
- /** @var $currentClass PheanstalkInterface */
36
+ /**
37
+ * @var $currentClass PheanstalkInterface
38
+ */
37
39
private $ currentClass ;
38
40
39
41
/**
@@ -65,7 +67,7 @@ public function getCurrentClass(): PheanstalkInterface
65
67
/**
66
68
* @param PheanstalkInterface $currentClass
67
69
*
68
- * @return Pheanstalk
70
+ * @return PheanstalkInterface
69
71
*/
70
72
public function setCurrentClass (PheanstalkInterface $ currentClass ): PheanstalkInterface
71
73
{
@@ -78,19 +80,17 @@ public function setCurrentClass(PheanstalkInterface $currentClass): PheanstalkIn
78
80
*/
79
81
public function delete (Workflow $ workflow )
80
82
{
81
- $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ]), CommandEvent::DELETE );
83
+ $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ])/* , CommandEvent::DELETE*/ );
82
84
83
- $ this ->pheanstalk ->delete ($ workflow );
84
-
85
- return $ this ;
85
+ return $ this ->pheanstalk ->delete ($ workflow );
86
86
}
87
87
88
88
/**
89
89
* {@inheritDoc}
90
90
*/
91
91
public function workflowExists ($ name )
92
92
{
93
- $ this ->dispatch (new CommandEvent ($ this , ['name ' => $ name ]), CommandEvent::WORKFLOW_EXISTS );
93
+ $ this ->dispatch (new CommandEvent ($ this , ['name ' => $ name ])/* , CommandEvent::WORKFLOW_EXISTS*/ );
94
94
95
95
return $ this ->pheanstalk ->workflowExists ($ name );
96
96
}
@@ -100,7 +100,7 @@ public function workflowExists($name)
100
100
*/
101
101
public function getWorkflow (Workflow $ workflow )
102
102
{
103
- $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ]), CommandEvent::TASK_EXISTS );
103
+ $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ])/* , CommandEvent::TASK_EXISTS*/ );
104
104
105
105
return $ this ->pheanstalk ->getWorkflow ($ workflow );
106
106
}
@@ -113,7 +113,7 @@ public function getWorkflowInstances(?Workflow $workflow = null, ?string $status
113
113
$ this ->dispatch (new CommandEvent ($ this , [
114
114
'workflow ' => $ workflow ,
115
115
'status ' => $ status
116
- ]), CommandEvent::WORKFLOW_INSTANCES );
116
+ ])/* , CommandEvent::WORKFLOW_INSTANCES*/ );
117
117
118
118
119
119
return $ this ->pheanstalk ->getWorkflowInstances ($ workflow , $ status );
@@ -124,8 +124,8 @@ public function getWorkflowInstances(?Workflow $workflow = null, ?string $status
124
124
*/
125
125
public function getWorkflowInstancesDetails (WorkflowInstance $ workflowInstance )
126
126
{
127
- $ this ->dispatch (new CommandEvent ($ this , ['workflowInstance ' => $ workflowInstance ]),
128
- CommandEvent::WORKFLOW_INSTANCES_DETAILS );
127
+ $ this ->dispatch (new CommandEvent ($ this , ['workflowInstance ' => $ workflowInstance ])/* ,
128
+ CommandEvent::WORKFLOW_INSTANCES_DETAILS*/ );
129
129
130
130
return $ this ->pheanstalk ->getWorkflowInstancesDetails ($ workflowInstance );
131
131
}
@@ -135,7 +135,7 @@ public function getWorkflowInstancesDetails(WorkflowInstance $workflowInstance)
135
135
*/
136
136
public function tubeExists ($ name )
137
137
{
138
- $ this ->dispatch (new CommandEvent ($ this , ['name ' => $ name ]), CommandEvent::TUBE_EXISTS );
138
+ $ this ->dispatch (new CommandEvent ($ this , ['name ' => $ name ])/* , CommandEvent::TUBE_EXISTS*/ );
139
139
140
140
return $ this ->pheanstalk ->tubeExists ($ name );
141
141
}
@@ -145,7 +145,7 @@ public function tubeExists($name)
145
145
*/
146
146
public function listTubes ()
147
147
{
148
- $ this ->dispatch (new CommandEvent ($ this ), CommandEvent::LIST_TUBES );
148
+ $ this ->dispatch (new CommandEvent ($ this )/* , CommandEvent::LIST_TUBES*/ );
149
149
150
150
return $ this ->pheanstalk ->listTubes ();
151
151
}
@@ -155,7 +155,7 @@ public function listTubes()
155
155
*/
156
156
public function peek ()
157
157
{
158
- $ this ->dispatch (new CommandEvent ($ this ), CommandEvent::PEEK );
158
+ $ this ->dispatch (new CommandEvent ($ this )/* , CommandEvent::PEEK*/ );
159
159
160
160
return $ this ->pheanstalk ->peek ();
161
161
}
@@ -165,7 +165,7 @@ public function peek()
165
165
*/
166
166
public function put (Workflow $ workflow )
167
167
{
168
- $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ]), CommandEvent::PUT );
168
+ $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ])/* , CommandEvent::PUT*/ );
169
169
170
170
return $ this ->pheanstalk ->put ($ workflow );
171
171
}
@@ -175,7 +175,7 @@ public function put(Workflow $workflow)
175
175
*/
176
176
public function statsTube (Tube $ tube )
177
177
{
178
- $ this ->dispatch (new CommandEvent ($ this , ['tube ' => $ tube ]), CommandEvent::STATS_TUBE );
178
+ $ this ->dispatch (new CommandEvent ($ this , ['tube ' => $ tube ])/* , CommandEvent::STATS_TUBE*/ );
179
179
180
180
return $ this ->pheanstalk ->statsTube ($ tube );
181
181
}
@@ -185,7 +185,7 @@ public function statsTube(Tube $tube)
185
185
*/
186
186
public function stats ()
187
187
{
188
- $ this ->dispatch (new CommandEvent ($ this ), CommandEvent::STATS );
188
+ $ this ->dispatch (new CommandEvent ($ this )/* , CommandEvent::STATS*/ );
189
189
190
190
return $ this ->pheanstalk ->stats ();
191
191
}
@@ -248,7 +248,7 @@ public function setName($name)
248
248
*/
249
249
public function create (Workflow $ workflow , $ force = false ): Workflow
250
250
{
251
- $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ]), CommandEvent::CREATE_WORKFLOW );
251
+ $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ])/* , CommandEvent::CREATE_WORKFLOW*/ );
252
252
253
253
$ workflow = $ this ->pheanstalk ->create ($ workflow );
254
254
return $ workflow ;
@@ -259,7 +259,7 @@ public function create(Workflow $workflow, $force = false): Workflow
259
259
*/
260
260
public function update (Workflow $ workflow ): Workflow
261
261
{
262
- $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ]), CommandEvent::UPDATE_WORKFLOW );
262
+ $ this ->dispatch (new CommandEvent ($ this , ['workflow ' => $ workflow ])/* , CommandEvent::UPDATE_WORKFLOW*/ );
263
263
264
264
return $ this ->pheanstalk ->update ($ workflow );
265
265
}
@@ -271,7 +271,7 @@ public function createSchedule(Schedule $schedule)
271
271
{
272
272
$ this ->dispatch (new CommandEvent ($ this , [
273
273
'schedule ' => $ schedule ,
274
- ]), CommandEvent::CREATE_SCHEDULE );
274
+ ])/* , CommandEvent::CREATE_SCHEDULE*/ );
275
275
276
276
$ workflowSchedule = $ this ->pheanstalk ->createSchedule ($ schedule );
277
277
return $ workflowSchedule ;
@@ -284,7 +284,7 @@ public function deleteSchedule(Schedule $schedule)
284
284
{
285
285
$ this ->dispatch (new CommandEvent ($ this , [
286
286
'schedule ' => $ schedule ,
287
- ]), CommandEvent::DELETE_SCHEDULE );
287
+ ])/* , CommandEvent::DELETE_SCHEDULE*/ );
288
288
289
289
return $ this ->pheanstalk ->deleteSchedule ($ schedule );
290
290
}
@@ -296,7 +296,7 @@ public function getSchedule(int $schedule)
296
296
{
297
297
$ this ->dispatch (new CommandEvent ($ this , [
298
298
'schedule ' => $ schedule ,
299
- ]), CommandEvent::GET_SCHEDULE );
299
+ ])/* , CommandEvent::GET_SCHEDULE*/ );
300
300
301
301
return $ this ->pheanstalk ->getSchedule ($ schedule );
302
302
}
@@ -308,7 +308,7 @@ public function updateSchedule(Schedule $schedule): Schedule
308
308
{
309
309
$ this ->dispatch (new CommandEvent ($ this , [
310
310
'schedule ' => $ schedule ,
311
- ]), CommandEvent::UPDATE_SCHEDULE );
311
+ ])/* , CommandEvent::UPDATE_SCHEDULE*/ );
312
312
313
313
return $ this ->pheanstalk ->updateSchedule ($ schedule );
314
314
}
@@ -318,7 +318,7 @@ public function updateSchedule(Schedule $schedule): Schedule
318
318
*/
319
319
public function listSchedules ()
320
320
{
321
- $ this ->dispatch (new CommandEvent ($ this , []), CommandEvent::LIST_SCHEDULE );
321
+ $ this ->dispatch (new CommandEvent ($ this , [])/* , CommandEvent::LIST_SCHEDULE*/ );
322
322
323
323
return $ this ->pheanstalk ->listSchedules ();
324
324
}
@@ -338,7 +338,7 @@ public function createTask(string $name, string $group, string $path, $queue = '
338
338
'host ' => $ host ,
339
339
'comment ' => $ comment
340
340
];
341
- $ this ->dispatch (new CommandEvent ($ this , $ datas ), CommandEvent::CREATE_TASK );
341
+ $ this ->dispatch (new CommandEvent ($ this , $ datas )/* , CommandEvent::CREATE_TASK*/ );
342
342
343
343
344
344
return $ this ->pheanstalk ->createTask ($ name , $ group , $ path , $ queue , $ useAgent , $ user , $ host , $ comment );
@@ -349,7 +349,7 @@ public function createTask(string $name, string $group, string $path, $queue = '
349
349
*/
350
350
public function createTube (Tube $ tube ): Tube
351
351
{
352
- $ this ->dispatch (new CommandEvent ($ this , ['tube ' => $ tube ]), CommandEvent::CREATE_TUBE );
352
+ $ this ->dispatch (new CommandEvent ($ this , ['tube ' => $ tube ])/* , CommandEvent::CREATE_TUBE*/ );
353
353
354
354
return $ this ->pheanstalk ->createTube ($ tube );
355
355
}
@@ -359,7 +359,7 @@ public function createTube(Tube $tube): Tube
359
359
*/
360
360
public function updateTube (Tube $ tube ): Tube
361
361
{
362
- $ this ->dispatch (new CommandEvent ($ this , ['tube ' => $ tube ]), CommandEvent::UPDATE_TUBE );
362
+ $ this ->dispatch (new CommandEvent ($ this , ['tube ' => $ tube ])/* , CommandEvent::UPDATE_TUBE*/ );
363
363
364
364
return $ this ->pheanstalk ->updateTube ($ tube );
365
365
}
@@ -369,14 +369,14 @@ public function updateTube(Tube $tube): Tube
369
369
*/
370
370
public function cancel (WorkflowInstance $ workflowInstance )
371
371
{
372
- $ this ->dispatch (new CommandEvent ($ this , ['workflowInstance ' => $ workflowInstance ]), CommandEvent::CANCEL );
372
+ $ this ->dispatch (new CommandEvent ($ this , ['workflowInstance ' => $ workflowInstance ])/* , CommandEvent::CANCEL*/ );
373
373
374
374
return $ this ->pheanstalk ->cancel ($ workflowInstance );
375
375
}
376
376
377
377
public function kill (WorkflowInstance $ workflowInstance , TaskInstance $ taskInstance )
378
378
{
379
- $ this ->dispatch (new CommandEvent ($ this , ['workflowInstance ' => $ workflowInstance , 'taskInstance ' => $ taskInstance ]), CommandEvent::CANCEL );
379
+ $ this ->dispatch (new CommandEvent ($ this , ['workflowInstance ' => $ workflowInstance , 'taskInstance ' => $ taskInstance ])/* , CommandEvent::CANCEL*/ );
380
380
381
381
return $ this ->pheanstalk ->kill ($ workflowInstance , $ taskInstance );
382
382
}
@@ -385,10 +385,10 @@ public function kill(WorkflowInstance $workflowInstance, TaskInstance $taskInsta
385
385
* @param CommandEvent $commandEvent
386
386
* @param string|null $eventName
387
387
*/
388
- protected function dispatch (CommandEvent $ commandEvent , string $ eventName = null )
388
+ protected function dispatch (CommandEvent $ commandEvent/* , string $eventName = null*/ )
389
389
{
390
390
if ($ this ->dispatcher ) {
391
- $ this ->dispatcher ->dispatch ($ commandEvent , $ eventName );
391
+ $ this ->dispatcher ->dispatch ($ commandEvent/* , $eventName */ );
392
392
}
393
393
}
394
394
}
0 commit comments