@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function __invoke(Job $jobEntity, $options = []) |
79 | 79 | { |
80 | - $options= array_merge($this->options, $options); |
|
80 | + $options = array_merge($this->options, $options); |
|
81 | 81 | |
82 | 82 | $ats = $jobEntity->getAtsMode(); |
83 | 83 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $urlHelper = $this->urlHelper; |
91 | 91 | |
92 | 92 | if ($ats->isIntern() || $ats->isEmail()) { |
93 | - $query = [ 'subscriberUri' => $serverUrlHelper(array()) . '/subscriber/' . 1 ]; |
|
93 | + $query = ['subscriberUri' => $serverUrlHelper(array()).'/subscriber/'.1]; |
|
94 | 94 | $route = 'lang/apply'; |
95 | 95 | $params = [ |
96 | 96 | 'applyId' => $jobEntity->getApplyId(), |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | if ($options['linkOnly']) { |
109 | - $result=$url; |
|
109 | + $result = $url; |
|
110 | 110 | if ($options['absolute'] && !preg_match('~^https?://~', $url)) { |
111 | 111 | $result = $serverUrlHelper($url); |
112 | 112 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | foreach ($options as $key=>$val) { |
127 | 127 | if (array_key_exists($this->options, $key)) { |
128 | - $this->options[$key]=$val; |
|
128 | + $this->options[$key] = $val; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | '@testConstructor*' => false, |
48 | 48 | ]; |
49 | 49 | |
50 | - private $inheritance = [ AbstractStrategy::class ]; |
|
50 | + private $inheritance = [AbstractStrategy::class]; |
|
51 | 51 | |
52 | 52 | private $attributes = [ |
53 | 53 | 'tmpl' => [ |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $logger = $this->target->getLogger(); |
113 | 113 | |
114 | - static::assertTrue((new \ReflectionClass($logger))->isAnonymous(),'getLogger did not return an anonymous NullLogger.'); |
|
114 | + static::assertTrue((new \ReflectionClass($logger))->isAnonymous(), 'getLogger did not return an anonymous NullLogger.'); |
|
115 | 115 | static::assertInstanceOf(LoggerInterface::class, $logger); |
116 | 116 | } |
117 | 117 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | private $target = IdleSleepStrategy::class; |
34 | 34 | |
35 | - private $inheritance = [ AbstractStrategy::class ]; |
|
35 | + private $inheritance = [AbstractStrategy::class]; |
|
36 | 36 | |
37 | 37 | |
38 | 38 | public function testSetDuration() |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | private $target = [ |
36 | 36 | MongoQueue::class, |
37 | 37 | 'setupArgs', |
38 | - '@testInheritance' => [ 'as_reflection' => true ], |
|
38 | + '@testInheritance' => ['as_reflection' => true], |
|
39 | 39 | '@testConstruction' => false, |
40 | 40 | '@testPushLazyWithStringName' => '#mockPush', |
41 | 41 | '@testPushLazyWithArraySpec' => '#mockPush', |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ] |
45 | 45 | ]; |
46 | 46 | |
47 | - private $inheritance = [ AbstractQueue::class ]; |
|
47 | + private $inheritance = [AbstractQueue::class]; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | && isset($value['created']) && isset($value['scheduled']) |
165 | 165 | && $value['scheduled'] instanceOf \MongoDB\BSON\UTCDateTime |
166 | 166 | && $value['created'] instanceOf \MongoDB\BSON\UTCDateTime |
167 | - && (int) ((string) $value['scheduled']) - (int) ((string)$value['created']) == $options['delay'] * 1000 |
|
167 | + && (int) ((string) $value['scheduled']) - (int) ((string) $value['created']) == $options['delay'] * 1000 |
|
168 | 168 | && isset($value['priority']) && $value['priority'] == $options['priority'] |
169 | 169 | ; |
170 | 170 | })) |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | ->with( |
188 | 188 | $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
189 | 189 | $this->callback(function($value) { |
190 | - if (!array_key_exists('$set', $value)) { return false;} |
|
190 | + if (!array_key_exists('$set', $value)) { return false; } |
|
191 | 191 | $value = $value['$set']; |
192 | 192 | return isset($value['tried']) && $value['tried'] == 10 |
193 | 193 | && !array_key_exists('created', $value) |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | }), |
222 | 222 | |
223 | 223 | $this->callback(function($value) { |
224 | - if (!array_key_exists('$set', $value)) { return false;} |
|
224 | + if (!array_key_exists('$set', $value)) { return false; } |
|
225 | 225 | $value = $value['$set']; |
226 | 226 | return isset($value['status']) && $value['status'] == MongoQueue::STATUS_RUNNING |
227 | 227 | && array_key_exists('executed', $value) |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $this->callback(function($value) { |
233 | 233 | return |
234 | 234 | isset($value['sort']) && $value['sort'] == ['priority' => 1, 'scheduled' => 1] |
235 | - && isset($value['returnDocument'])&&$value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER |
|
235 | + && isset($value['returnDocument']) && $value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER |
|
236 | 236 | ; |
237 | 237 | })) |
238 | 238 | ->willReturn($envelope); |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | /* @var AbstractJob $job2 */ |
260 | 260 | $job1 = new $this->testJobClass('TestJob1'); |
261 | 261 | $job2 = new $this->testJobClass('TestJob2'); |
262 | - $filter = [ 'queue' => $this->queueName ]; |
|
263 | - $opt = [ 'sort' => [ 'scheduled' => 1, 'priority' => 1 ] ]; |
|
262 | + $filter = ['queue' => $this->queueName]; |
|
263 | + $opt = ['sort' => ['scheduled' => 1, 'priority' => 1]]; |
|
264 | 264 | $envelopes = [ |
265 | 265 | [ |
266 | 266 | '_id' => $job1->getId(), |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | ], |
277 | 277 | ]; |
278 | 278 | $this->jobManagerMock->expects($this->exactly(2))->method('get') |
279 | - ->with($this->testJobClass)->will($this->returnCallback(function () { return new $this->testJobClass(); })); |
|
279 | + ->with($this->testJobClass)->will($this->returnCallback(function() { return new $this->testJobClass(); })); |
|
280 | 280 | |
281 | 281 | $cursor = new class($envelopes) { |
282 | 282 | private $envelopes; |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | $jobs = $this->target->listing(); |
294 | 294 | |
295 | 295 | $this->assertEquals(1, $cursor->called, "Cursor::toArray should have been called exactly one time, but was called '{$cursor->called}' times'"); |
296 | - $this->assertTrue(is_array($jobs), 'Return value should have been an array, but is "' . gettype($jobs) . '" instead."'); |
|
297 | - $this->assertTrue(2 == count($jobs), 'Only 2 jobs should have been returned, but it were ' . count($jobs)); |
|
296 | + $this->assertTrue(is_array($jobs), 'Return value should have been an array, but is "'.gettype($jobs).'" instead."'); |
|
297 | + $this->assertTrue(2 == count($jobs), 'Only 2 jobs should have been returned, but it were '.count($jobs)); |
|
298 | 298 | |
299 | 299 | $this->assertArrayHasKey('job', $jobs[0]); |
300 | 300 | $this->assertEquals($job1, $jobs[0]['job'], 'Job1 is not the same'); |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | 'limit' => 10, |
311 | 311 | ]; |
312 | 312 | |
313 | - $filter = [ 'queue' => $this->queueName, 'status' => $options['status'] ]; |
|
314 | - $opt = [ 'sort' => [ 'scheduled' => 1, 'priority' => 1 ], 'limit' => $options['limit'] ]; |
|
313 | + $filter = ['queue' => $this->queueName, 'status' => $options['status']]; |
|
314 | + $opt = ['sort' => ['scheduled' => 1, 'priority' => 1], 'limit' => $options['limit']]; |
|
315 | 315 | |
316 | 316 | $this->jobManagerMock->expects($this->never())->method('get'); |
317 | 317 | $cursor = new class() { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | ->with( |
338 | 338 | $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
339 | 339 | $this->callback(function($value) use ($options) { |
340 | - if (!array_key_exists('$set', $value)) { return false;} |
|
340 | + if (!array_key_exists('$set', $value)) { return false; } |
|
341 | 341 | $value = $value['$set']; |
342 | 342 | return isset($value['status']) && $value['status'] == MongoQueue::STATUS_FAILED |
343 | 343 | && !array_key_exists('created', $value) |
@@ -27,5 +27,5 @@ |
||
27 | 27 | |
28 | 28 | private $target = RecoverableJobException::class; |
29 | 29 | |
30 | - private $inheritance = [ AbstractJobException::class ]; |
|
30 | + private $inheritance = [AbstractJobException::class]; |
|
31 | 31 | } |
@@ -27,5 +27,5 @@ |
||
27 | 27 | |
28 | 28 | private $target = FatalJobException::class; |
29 | 29 | |
30 | - private $inheritance = [ AbstractJobException::class ]; |
|
30 | + private $inheritance = [AbstractJobException::class]; |
|
31 | 31 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | '@testConstruction' => false, |
32 | 32 | ]; |
33 | 33 | |
34 | - private $inheritance = [ JobExceptionInterface::class, \RuntimeException::class ]; |
|
34 | + private $inheritance = [JobExceptionInterface::class, \RuntimeException::class]; |
|
35 | 35 | |
36 | 36 | public function provideConstructionTestData() |
37 | 37 | { |
@@ -41,12 +41,12 @@ |
||
41 | 41 | private $target = [ |
42 | 42 | MongoWorker::class, |
43 | 43 | 'setupConstructorArgs', |
44 | - '@testInheritance' => [ 'as_reflection' => true ] |
|
44 | + '@testInheritance' => ['as_reflection' => true] |
|
45 | 45 | ]; |
46 | 46 | |
47 | 47 | private $eventsMock; |
48 | 48 | |
49 | - private $inheritance = [ AbstractWorker::class ]; |
|
49 | + private $inheritance = [AbstractWorker::class]; |
|
50 | 50 | |
51 | 51 | private function setupConstructorArgs() |
52 | 52 | { |
@@ -30,5 +30,5 @@ |
||
30 | 30 | 'as_reflection' => true, |
31 | 31 | ]; |
32 | 32 | |
33 | - private $inheritance = [ AbstractWorkerController::class ]; |
|
33 | + private $inheritance = [AbstractWorkerController::class]; |
|
34 | 34 | } |