Passed
Push — master ( 18af30...0e6a78 )
by Mathias
45:31 queued 28:39
created
module/Jobs/src/View/Helper/ApplyUrl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Strategy/LogStrategyTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Strategy/IdleSleepStrategyTest.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@
 block discarded – undo
46 46
     {
47 47
         $events = $this->prophesize(EventManagerInterface::class);
48 48
         $events->attach(AbstractWorkerEvent::EVENT_PROCESS_IDLE, [$this->target, 'onIdle'], 1)
49
-               ->willReturn('handle')
50
-               ->shouldBeCalled();
49
+                ->willReturn('handle')
50
+                ->shouldBeCalled();
51 51
 
52 52
         $this->target->attach($events->reveal());
53 53
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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()
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/MongoQueueTest.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -152,12 +152,12 @@  discard block
 block discarded – undo
152 152
             'delay' => 100,
153 153
         ];
154 154
         $resultMock = $this->getMockBuilder(\MongoDB\InsertOneResult::class)->disableOriginalConstructor()
155
-                           ->setMethods(['getInsertedId'])->getMock();
155
+                            ->setMethods(['getInsertedId'])->getMock();
156 156
         $resultMock->expects($this->once())->method('getInsertedId')->willReturn('ID');
157 157
         $this->mongoCollectionMock->expects($this->once())->method('insertOne')
158
-                                  ->with($this->callback(function($value) use ($options) {
158
+                                    ->with($this->callback(function($value) use ($options) {
159 159
 
160
-                                      return isset($value['queue']) && $value['queue'] == $this->queueName
160
+                                        return isset($value['queue']) && $value['queue'] == $this->queueName
161 161
                                              && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING
162 162
                                              && !isset($value['tried'])
163 163
                                              && !isset($value['message']) && !isset($value['trace'])
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
                                              && $value['created'] instanceOf \MongoDB\BSON\UTCDateTime
167 167
                                              && (int) ((string) $value['scheduled']) - (int) ((string)$value['created']) == $options['delay'] * 1000
168 168
                                              && isset($value['priority']) && $value['priority'] == $options['priority']
169
-                                          ;
170
-                                  }))
171
-                                  ->willReturn($resultMock);
169
+                                            ;
170
+                                    }))
171
+                                    ->willReturn($resultMock);
172 172
 
173 173
         $this->target->push($job, $options);
174 174
 
@@ -184,17 +184,17 @@  discard block
 block discarded – undo
184 184
 
185 185
 
186 186
         $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate')
187
-                                  ->with(
188
-                                      $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]),
189
-                                      $this->callback(function($value) {
190
-                                          if (!array_key_exists('$set', $value)) { return false;}
191
-                                          $value = $value['$set'];
187
+                                    ->with(
188
+                                        $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]),
189
+                                        $this->callback(function($value) {
190
+                                            if (!array_key_exists('$set', $value)) { return false;}
191
+                                            $value = $value['$set'];
192 192
                                         return isset($value['tried']) && $value['tried'] == 10
193 193
                                                 && !array_key_exists('created', $value)
194 194
                                         ;
195
-                                      }
196
-                                  ))
197
-                                  ->willReturn(null);
195
+                                        }
196
+                                    ))
197
+                                    ->willReturn(null);
198 198
 
199 199
         $this->target->retry($job);
200 200
     }
@@ -211,31 +211,31 @@  discard block
 block discarded – undo
211 211
 
212 212
         $this->jobManagerMock->expects($this->once())->method('get')->with(get_class($job))->willReturn(new $this->testJobClass());
213 213
         $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate')
214
-                                  ->with(
215
-                                      $this->callback(function($value) {
216
-                                          return
214
+                                    ->with(
215
+                                        $this->callback(function($value) {
216
+                                            return
217 217
                                                     isset($value['queue']) && $value['queue'] == $this->queueName
218 218
                                                     && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING
219 219
                                                     && isset($value['scheduled']['$lte']) && $value['scheduled']['$lte'] instanceOf \MongoDB\BSON\UTCDateTime
220
-                                              ;
221
-                                      }),
220
+                                                ;
221
+                                        }),
222 222
 
223
-                                      $this->callback(function($value) {
224
-                                          if (!array_key_exists('$set', $value)) { return false;}
225
-                                          $value = $value['$set'];
226
-                                          return isset($value['status']) && $value['status'] == MongoQueue::STATUS_RUNNING
223
+                                        $this->callback(function($value) {
224
+                                            if (!array_key_exists('$set', $value)) { return false;}
225
+                                            $value = $value['$set'];
226
+                                            return isset($value['status']) && $value['status'] == MongoQueue::STATUS_RUNNING
227 227
                                                  && array_key_exists('executed', $value)
228
-                                              ;
229
-                                      }
230
-                                      ),
228
+                                                ;
229
+                                        }
230
+                                        ),
231 231
 
232
-                                      $this->callback(function($value) {
233
-                                          return
232
+                                        $this->callback(function($value) {
233
+                                            return
234 234
                                             isset($value['sort']) && $value['sort'] == ['priority' => 1, 'scheduled' => 1]
235 235
                                               && isset($value['returnDocument'])&&$value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER
236
-                                              ;
237
-                                      }))
238
-                                  ->willReturn($envelope);
236
+                                                ;
237
+                                        }))
238
+                                    ->willReturn($envelope);
239 239
 
240 240
         $actualJob = $this->target->pop();
241 241
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     public function testPopEmptyQueue()
246 246
     {
247 247
         $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate')
248
-                                  ->willReturn(null);
248
+                                    ->willReturn(null);
249 249
 
250 250
         $actualJob = $this->target->pop();
251 251
 
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
         };
320 320
 
321 321
         $this->mongoCollectionMock->expects($this->once())->method('find')
322
-                                  ->with($filter, $opt)
323
-                                  ->willReturn($cursor);
322
+                                    ->with($filter, $opt)
323
+                                    ->willReturn($cursor);
324 324
 
325 325
         $this->target->listing($options);
326 326
 
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
         $job->setId(new \MongoDB\BSON\ObjectID());
335 335
         $options = ['message' => 'test failure message'];
336 336
         $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate')
337
-                                  ->with(
338
-                                      $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]),
339
-                                      $this->callback(function($value) use ($options) {
340
-                                          if (!array_key_exists('$set', $value)) { return false;}
341
-                                          $value = $value['$set'];
342
-                                          return isset($value['status']) && $value['status'] == MongoQueue::STATUS_FAILED
337
+                                    ->with(
338
+                                        $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]),
339
+                                        $this->callback(function($value) use ($options) {
340
+                                            if (!array_key_exists('$set', $value)) { return false;}
341
+                                            $value = $value['$set'];
342
+                                            return isset($value['status']) && $value['status'] == MongoQueue::STATUS_FAILED
343 343
                                                  && !array_key_exists('created', $value)
344 344
                                                 && !array_key_exists('scheduled', $value)
345 345
                                               && isset($value['message']) && $value['message'] == $options['message']
346
-                                              ;
347
-                                      }
348
-                                      ))
349
-                                  ->willReturn(null);
346
+                                                ;
347
+                                        }
348
+                                        ))
349
+                                    ->willReturn(null);
350 350
 
351 351
         $this->target->fail($job, $options);
352 352
     }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Exception/RecoverableExceptionTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,5 +27,5 @@
 block discarded – undo
27 27
 
28 28
     private $target = RecoverableJobException::class;
29 29
 
30
-    private $inheritance = [ AbstractJobException::class ];
30
+    private $inheritance = [AbstractJobException::class];
31 31
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Exception/FatalJobExceptionTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,5 +27,5 @@
 block discarded – undo
27 27
 
28 28
     private $target = FatalJobException::class;
29 29
 
30
-    private $inheritance = [ AbstractJobException::class ];
30
+    private $inheritance = [AbstractJobException::class];
31 31
 }
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Exception/AbstractJobExceptionTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Worker/MongoWorkerTest.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
     public function testDoesDeleteJobIfProcessedSuccessfully()
73 73
     {
74
-         /* @var AbstractJob $jobMock */
74
+            /* @var AbstractJob $jobMock */
75 75
         $job = $this->prophesize(AbstractJob::class);
76 76
         $job->execute()->willReturn(ProcessJobEvent::JOB_STATUS_SUCCESS);
77 77
         $jobMock = $job->reveal();
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $options = ['delay' => 10];
92 92
 
93
-         /* @var AbstractJob $jobMock */
93
+            /* @var AbstractJob $jobMock */
94 94
         $job = $this->prophesize(AbstractJob::class);
95 95
         $job->execute()->willThrow(new RecoverableJobException('test recoverable', $options));
96 96
         $jobMock = $job->reveal();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Queue/Controller/MongoQueueControllerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,5 +30,5 @@
 block discarded – undo
30 30
         'as_reflection' => true,
31 31
     ];
32 32
 
33
-    private $inheritance = [ AbstractWorkerController::class ];
33
+    private $inheritance = [AbstractWorkerController::class];
34 34
 }
Please login to merge, or discard this patch.