Passed
Push — master ( 18af30...0e6a78 )
by Mathias
45:31 queued 28:39
created
module/Jobs/src/Queue/FetchExternalImageJob.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -58,40 +58,40 @@
 block discarded – undo
58 58
         $jobEntity = $this->repository->find($payload['jobId']);
59 59
 
60 60
         if (!$jobEntity) {
61
-            return $this->failure('No job entity with the id ' . $payload['jobId'] . ' was found.');
61
+            return $this->failure('No job entity with the id '.$payload['jobId'].' was found.');
62 62
         }
63 63
 
64 64
         $uri = $jobEntity->getLogoRef();
65 65
 
66 66
         if (0 !== strpos($uri, 'http')) {
67
-            $logger->notice('logoRef seems not to be external: ' . $uri);
67
+            $logger->notice('logoRef seems not to be external: '.$uri);
68 68
             return $this->success('Skip fetching for this job.');
69 69
         }
70 70
 
71
-        $logger->debug('Trying to fetch image from ' . $uri);
71
+        $logger->debug('Trying to fetch image from '.$uri);
72 72
 
73 73
         $client = new Client($uri);
74 74
         $response = $client->send();
75 75
 
76 76
         if (200 != $response->getStatusCode()) {
77
-            $logger->err('Received status code ' . $response->getStatusCode() . ' when trying to fetch ' . $uri);
77
+            $logger->err('Received status code '.$response->getStatusCode().' when trying to fetch '.$uri);
78 78
 
79
-            return $this->recoverable('Status code ' . $response->getStatusCode() . ' received.', ['delay' => '+5 minutes']);
79
+            return $this->recoverable('Status code '.$response->getStatusCode().' received.', ['delay' => '+5 minutes']);
80 80
         }
81 81
 
82 82
         $content = $response->getBody();
83 83
         $type = $response->getHeaders()->get('Content-Type')->getFieldValue();
84 84
         list(,$ext) = explode('/', $type, 2);
85
-        $imageName = '/static/Jobs/logos/' . $jobEntity->getId() . '.' . $ext;
85
+        $imageName = '/static/Jobs/logos/'.$jobEntity->getId().'.'.$ext;
86 86
 
87 87
         if (false === file_put_contents("public$imageName", $content, FILE_BINARY)) {
88
-            return $this->failure('Writing image to "public' . $imageName . '" failed.');
88
+            return $this->failure('Writing image to "public'.$imageName.'" failed.');
89 89
         }
90 90
 
91
-        $logger->info('Saved job logo as ' . basename($imageName));
91
+        $logger->info('Saved job logo as '.basename($imageName));
92 92
         $jobEntity->setLogoRef($imageName);
93 93
         $this->repository->store($jobEntity);
94
-        $logger->info('Saved job logo as ' . basename($imageName));
94
+        $logger->info('Saved job logo as '.basename($imageName));
95 95
 
96 96
         return $this->success();
97 97
     }
Please login to merge, or discard this patch.
module/Jobs/src/Queue/FindJobsWithExternalImageJob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
         foreach ($cursor->toArray() as $job) {
75 75
             if (0 === strpos($job->getLogoRef(), 'http')) {
76 76
                 $queue->push(FetchExternalImageJob::create($job));
77
-                $logger->debug('Found external image uri: ' . $job->getLogoRef());
78
-                $logger->info('Pushed fetch image job for Job: '  . $job->getId());
77
+                $logger->debug('Found external image uri: '.$job->getLogoRef());
78
+                $logger->info('Pushed fetch image job for Job: '.$job->getId());
79 79
             } else {
80 80
                 $invalidJobs += 1;
81 81
             }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $delay = 0 >= ($cursor->count() - $invalidJobs) ? '+2 hours' : '+5 minutes';
85 85
         $queue->push(self::create(), ['delay' => $delay]);
86
-        $logger->info('Reinserted to fetch more jobs with delay: ' . $delay);
86
+        $logger->info('Reinserted to fetch more jobs with delay: '.$delay);
87 87
 
88 88
         return $this->success();
89 89
     }
Please login to merge, or discard this patch.
module/Core/src/Queue/MongoQueue.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         $time      = microtime(true);
212 212
         $micro     = sprintf("%06d", ($time - floor($time)) * 1000000);
213 213
         $this->now = new \DateTime(
214
-            date('Y-m-d H:i:s.' . $micro, $time),
214
+            date('Y-m-d H:i:s.'.$micro, $time),
215 215
             new \DateTimeZone(date_default_timezone_get())
216 216
         );
217 217
         $now = $this->dateTimeToUTCDateTime($this->now);
@@ -250,12 +250,12 @@  discard block
 block discarded – undo
250 250
      */
251 251
     public function listing(array $options = [])
252 252
     {
253
-        $filter = [ 'queue' => $this->getName() ];
253
+        $filter = ['queue' => $this->getName()];
254 254
         if (isset($options['status'])) {
255 255
             $filter['status'] = $options['status'];
256 256
         }
257 257
 
258
-        $opt = [ 'sort' => [ 'scheduled' => 1, 'priority' => 1] ];
258
+        $opt = ['sort' => ['scheduled' => 1, 'priority' => 1]];
259 259
         if (isset($options['limit'])) {
260 260
             $opt['limit'] = $options['limit'];
261 261
         }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     {
337 337
         $time      = microtime(true);
338 338
         $micro     = sprintf("%06d", ($time - floor($time)) * 1000000);
339
-        $this->now = new \DateTime(date('Y-m-d H:i:s.' . $micro, $time), new \DateTimeZone(date_default_timezone_get()));
339
+        $this->now = new \DateTime(date('Y-m-d H:i:s.'.$micro, $time), new \DateTimeZone(date_default_timezone_get()));
340 340
         $scheduled = isset($options['scheduled']) ? Utils::createDateTime($options['scheduled']) : clone ($this->now);
341 341
 
342 342
         if (isset($options['delay'])) {
Please login to merge, or discard this patch.
module/Core/src/Queue/Strategy/JobResultStrategy.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
             $logger && $logger->warn($reason, $extra ?? []);
77 77
 
78 78
             if ($delay) {
79
-                $logger && $logger->notice('Will retry in ' . $this->formatDelay($delay));
79
+                $logger && $logger->notice('Will retry in '.$this->formatDelay($delay));
80 80
                 $options['delay'] = $delay;
81 81
 
82 82
             } elseif ($date) {
83
-                $logger && $logger->notice('Will retry on ' . $this->formatScheduled($date));
83
+                $logger && $logger->notice('Will retry on '.$this->formatScheduled($date));
84 84
                 $options['scheduled'] = $date;
85 85
             }
86 86
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             return;
90 90
         }
91 91
 
92
-        $logger && $logger->warn('Unsupported job result: ' . $result->getResult() . '; Job will be deleted.');
92
+        $logger && $logger->warn('Unsupported job result: '.$result->getResult().'; Job will be deleted.');
93 93
         $queue->delete($job);
94 94
 
95 95
     }
@@ -99,22 +99,22 @@  discard block
 block discarded – undo
99 99
         $delay = Utils::createDateInterval($delay);
100 100
         $parts = [];
101 101
         if ($delay->y) {
102
-            $parts[] = $delay->y . ' years';
102
+            $parts[] = $delay->y.' years';
103 103
         }
104 104
         if ($delay->m) {
105
-            $parts[] = $delay->m . ' months';
105
+            $parts[] = $delay->m.' months';
106 106
         }
107 107
         if ($delay->d) {
108
-            $parts[] = $delay->d . ' days';
108
+            $parts[] = $delay->d.' days';
109 109
         }
110 110
         if ($delay->h) {
111
-            $parts[] = $delay->h . ' hours';
111
+            $parts[] = $delay->h.' hours';
112 112
         }
113 113
         if ($delay->i) {
114
-            $parts[] = $delay->i . ' minutes';
114
+            $parts[] = $delay->i.' minutes';
115 115
         }
116 116
         if ($delay->s) {
117
-            $parts[] = $delay->s . ' seconds';
117
+            $parts[] = $delay->s.' seconds';
118 118
         }
119 119
 
120 120
         return join(', ', $parts);
Please login to merge, or discard this patch.
module/Core/src/Queue/Worker/MongoWorker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         try {
55 55
             return $job->execute();
56 56
         } catch (\Exception $exception) {
57
-            $this->getLogger()->err('Job execution thrown exception: ' . get_class($exception));
57
+            $this->getLogger()->err('Job execution thrown exception: '.get_class($exception));
58 58
 
59 59
             if ($job instanceOf ResultProviderInterface) {
60 60
                 $job->setResult(JobResult::failure($exception->getMessage(), [$exception->getTraceAsString()]));
Please login to merge, or discard this patch.
module/Core/src/Queue/Job/JobResult.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
     {
84 84
         return static::create(
85 85
             ProcessJobEvent::JOB_STATUS_FAILURE_RECOVERABLE,
86
-            [ 'reason' => $reason ] + $options
86
+            ['reason' => $reason] + $options
87 87
         );
88 88
     }
89 89
 
Please login to merge, or discard this patch.
module/Jobs/src/Entity/TemplateValues.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @var String
39 39
      * @ODM\Field(type="string")
40 40
      */
41
-    protected $qualifications='';
41
+    protected $qualifications = '';
42 42
 
43 43
     /**
44 44
      * Requirements field of the job template
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @var String
47 47
      * @ODM\Field(type="string")
48 48
      */
49
-    protected $requirements='';
49
+    protected $requirements = '';
50 50
 
51 51
     /**
52 52
      * Benefits field of the job template
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      * @var String
55 55
      * @ODM\Field(type="string")
56 56
      */
57
-    protected $benefits='';
57
+    protected $benefits = '';
58 58
 
59 59
     /**
60 60
      * Job title field of the job template
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @var String
63 63
      * @ODM\Field(type="string")
64 64
      */
65
-    protected $title='';
65
+    protected $title = '';
66 66
 
67 67
     /**
68 68
      * Company description field of the job template
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * @var String
71 71
      * @ODM\Field(type="string")
72 72
      */
73
-    protected $description='';
73
+    protected $description = '';
74 74
 
75 75
     /**
76 76
      * language of the job template values. Must be a valid ISO 639-1 code
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      * @var String
79 79
      * @ODM\Field(type="string")
80 80
      */
81
-    protected $language='en';
81
+    protected $language = 'en';
82 82
 
83 83
     /**
84 84
      * Pure HTML
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @var string
88 88
      * @since 0.29
89 89
      */
90
-    protected $html='';
90
+    protected $html = '';
91 91
 
92 92
     /**
93 93
      * Introduction text for the job template
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function setQualifications($qualifications)
122 122
     {
123
-        $this->qualifications= (string) $qualifications;
123
+        $this->qualifications = (string) $qualifications;
124 124
         return $this;
125 125
     }
126 126
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function setRequirements($requirements)
144 144
     {
145
-        $this->requirements=(string) $requirements;
145
+        $this->requirements = (string) $requirements;
146 146
         return $this;
147 147
     }
148 148
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function setBenefits($benefits)
166 166
     {
167
-        $this->benefits=(string) $benefits;
167
+        $this->benefits = (string) $benefits;
168 168
         return $this;
169 169
     }
170 170
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      */
187 187
     public function setTitle($title)
188 188
     {
189
-        $this->title=(string) $title;
189
+        $this->title = (string) $title;
190 190
         return $this;
191 191
     }
192 192
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      */
209 209
     public function setDescription($description)
210 210
     {
211
-        $this->description=(string) $description;
211
+        $this->description = (string) $description;
212 212
         return $this;
213 213
     }
214 214
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      */
231 231
     public function setLanguage($language)
232 232
     {
233
-        $this->language=(string) $language;
233
+        $this->language = (string) $language;
234 234
         return $this;
235 235
     }
236 236
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
     public function __get($property)
341 341
     {
342
-        $getter = "get" . ucfirst($property);
342
+        $getter = "get".ucfirst($property);
343 343
         if (method_exists($this, $getter)) {
344 344
             return $this->$getter();
345 345
         }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     public function __set($property, $value)
355 355
     {
356 356
         //$this->checkWriteAccess();
357
-        $setter = 'set' . ucfirst($property);
357
+        $setter = 'set'.ucfirst($property);
358 358
         if (method_exists($this, $setter)) {
359 359
             $this->$setter($value);
360 360
             return;
Please login to merge, or discard this patch.