Skip to content

Commit cab3b29

Browse files
author
vcorre
committed
Running phpcbf
1 parent 4e2d245 commit cab3b29

File tree

11 files changed

+19
-27
lines changed

11 files changed

+19
-27
lines changed

src/Command/TubeExistsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function parseResponse($responseLine, $responseData)
4646
$tubes = parent::parseResponse($responseLine, $responseData);
4747

4848
$name = $this->name;
49-
$matchingTubes = $tubes->filter(function(Tube $tube) use ($name) {
49+
$matchingTubes = $tubes->filter(function (Tube $tube) use ($name) {
5050
return $tube->getName() === $name;
5151
});
5252

src/Command/WorkflowExistsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function parseResponse($responseLine, $responseData)
4646
$workflows = parent::parseResponse($responseLine, $responseData);
4747

4848
$name = $this->name;
49-
$matchingWorkflows = $workflows->filter(function(Workflow $workflow) use ($name) {
49+
$matchingWorkflows = $workflows->filter(function (Workflow $workflow) use ($name) {
5050
return $workflow->getName() === $name;
5151
});
5252

src/Pheanstalk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public function create(Workflow $workflow, $force = false): Workflow
288288
public function findWorkflow(Workflow $workflow)
289289
{
290290
$workflows = $this->_dispatch(new Command\ListWorkflowsCommand());
291-
return $workflows->filter(function(Workflow $listedWorkflow) use ($workflow) {
291+
return $workflows->filter(function (Workflow $listedWorkflow) use ($workflow) {
292292
return $listedWorkflow->getName() === $workflow->getName()
293293
&& $listedWorkflow->getGroup() === $workflow->getGroup();
294294
})->first();

src/Structure/Job.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getTasks(): ArrayCollection
3535
*/
3636
public function setTasks(ArrayCollection $tasks): Job
3737
{
38-
$this->tasks = $tasks->filter(function(Task $task) {
38+
$this->tasks = $tasks->filter(function (Task $task) {
3939
return true;
4040
});
4141
return $this;

src/Structure/JobInstance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getTaskInstances(): ArrayCollection
3535
*/
3636
public function setTaskInstances(ArrayCollection $taskInstances): JobInstance
3737
{
38-
$this->taskInstances = $taskInstances->filter(function(TaskInstance $taskInstance) {
38+
$this->taskInstances = $taskInstances->filter(function (TaskInstance $taskInstance) {
3939
return true;
4040
});
4141
return $this;

src/Structure/ParameterManipulations.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace Pheanstalk\Structure;
55

6-
76
use Doctrine\Common\Collections\ArrayCollection;
87

98
class ParameterManipulations
@@ -47,4 +46,4 @@ public function fillWithSnakeParams(array $params, $glue = '_')
4746
}
4847
}
4948
}
50-
}
49+
}

src/Structure/Schedule.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
namespace Pheanstalk\Structure;
55

6-
76
class Schedule
87
{
98
const FAILURE_TYPE_CONTINUE = "CONTINUE";
@@ -226,5 +225,4 @@ public function setWorkflow(int $workflow): Schedule
226225
$this->workflow = $workflow;
227226
return $this;
228227
}
229-
230-
}
228+
}

src/Structure/Workflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function getJobs(): ArrayCollection
138138
*/
139139
public function setJobs(ArrayCollection $jobs): Workflow
140140
{
141-
$this->jobs = $jobs->filter(function(Job $job) {
141+
$this->jobs = $jobs->filter(function (Job $job) {
142142
return true;
143143
});
144144
return $this;

tests/Pheanstalk/PheanstalkTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testEmptyWorkflowInstances()
7070
{
7171
$workflow = $this->pheanstalk->workflowExists('testWorkflow');
7272
$instances = $this->pheanstalk->getWorkflowInstances($workflow);
73-
foreach(GetWorkflowInstancesCommand::FILTERS as $filter) {
73+
foreach (GetWorkflowInstancesCommand::FILTERS as $filter) {
7474
$this->assertNotNull($FilterInstances = $instances->get(strtolower($filter)));
7575
$workflowInstances = $FilterInstances->get('workflow_instances');
7676
$this->assertNull($workflowInstances);
@@ -88,11 +88,11 @@ public function testGetWorkflowInstances()
8888
$workflow = $this->pheanstalk->workflowExists('testWorkflow');
8989
$id = (int) $this->pheanstalk->put($workflow);
9090
$instances = $this->pheanstalk->getWorkflowInstances($workflow);
91-
foreach(GetWorkflowInstancesCommand::FILTERS as $filter) {
91+
foreach (GetWorkflowInstancesCommand::FILTERS as $filter) {
9292
$this->assertNotNull($FilterInstances = $instances->get(strtolower($filter)));
9393
$workflowInstances = $FilterInstances->get('workflow_instances');
9494
/** @var ArrayCollection $workflowInstances */
95-
if(!is_null($workflowInstances)) {
95+
if (!is_null($workflowInstances)) {
9696
$this->assertFalse($workflowInstances->isEmpty());
9797
}
9898
}
@@ -101,8 +101,8 @@ public function testGetWorkflowInstances()
101101
public function testListTubes()
102102
{
103103
$tubes = $this->pheanstalk->listTubes();
104-
$tubes = $tubes->filter(function(Tube $tube) {
105-
return $tube->getName() === 'testTube';
104+
$tubes = $tubes->filter(function (Tube $tube) {
105+
return $tube->getName() === 'testTube';
106106
});
107107
$this->assertFalse($tubes->isEmpty());
108108
}
@@ -168,12 +168,12 @@ public function testCancel()
168168

169169
protected function cancelFirstRunningInstance(Workflow $workflow)
170170
{
171-
try{
171+
try {
172172
$instances = $this->pheanstalk->getWorkflowInstances($workflow, GetWorkflowInstancesCommand::FILTER_EXECUTING);
173173
$this->assertFalse($instances->isEmpty());
174174
$workflowInstance = $instances->first();
175175
$this->assertTrue($this->pheanstalk->cancel($workflowInstance));
176-
} catch(ServerException $e){
176+
} catch (ServerException $e) {
177177
$this->cancelFirstRunningInstance($workflow);
178178
}
179179
}
@@ -195,7 +195,7 @@ public function testShouldFailWithNoPid()
195195
$instances = $this->pheanstalk->getWorkflowInstances($workflow, GetWorkflowInstancesCommand::FILTER_EXECUTING);
196196
$this->assertFalse($instances->isEmpty());
197197
/** @var WorkflowInstance $workflowInstance */
198-
$workflowInstance = $instances->filter(function(WorkflowInstance $instance) {
198+
$workflowInstance = $instances->filter(function (WorkflowInstance $instance) {
199199
return $instance->getStatus() === 'RUNNING';
200200
})->first();
201201
/** @var JobInstance $jobInstance */
@@ -209,19 +209,19 @@ public function testShouldFailWithNoPid()
209209

210210
protected function killFirstRunningInstance(Workflow $workflow)
211211
{
212-
try{
212+
try {
213213
$instances = $this->pheanstalk->getWorkflowInstances($workflow, GetWorkflowInstancesCommand::FILTER_EXECUTING);
214214
$this->assertFalse($instances->isEmpty());
215215
/** @var WorkflowInstance $workflowInstance */
216-
$workflowInstance = $instances->filter(function(WorkflowInstance $instance) {
216+
$workflowInstance = $instances->filter(function (WorkflowInstance $instance) {
217217
return $instance->getStatus() === 'RUNNING';
218218
})->first();
219219
/** @var JobInstance $jobInstance */
220220
$jobInstance = $workflowInstance->getJobInstances()->first();
221221
$taskInstance = $jobInstance->getTaskInstances()->first();
222222

223223
$this->assertTrue($this->pheanstalk->kill($workflowInstance, $taskInstance));
224-
} catch(ServerException $e){
224+
} catch (ServerException $e) {
225225
$this->killFirstRunningInstance($workflow);
226226
}
227227
}

tests/Pheanstalk/Socket/NativeSocketTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,3 @@ public function testShouldFailToReadInTimeout()
7474
}
7575
}
7676
}
77-
78-
79-
80-

0 commit comments

Comments
 (0)