Completed
Push — next ( 65b449...c05e12 )
by Mathias
08:19
created
config/module.config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
                 ],
20 20
             ],
21 21
             'annotation' => [
22
-                'paths' => [ __DIR__ . '/../src/Entity']
22
+                'paths' => [ __DIR__ . '/../src/Entity' ]
23 23
             ],
24 24
         ],
25 25
     ],
@@ -64,6 +64,6 @@  discard block
 block discarded – undo
64 64
                 ],
65 65
                 'lazy' => true,
66 66
             ],
67
-        ]],
67
+        ] ],
68 68
     ],
69 69
 ];
Please login to merge, or discard this patch.
src/Listener/JobsListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
         $job     = $event->getJobEntity();
57 57
         $options = $event->getParam('extraData');
58
-        $options = isset($options[ 'channels' ][ 'stackoverflow' ]) ? $options[ 'channels' ][ 'stackoverflow' ] : [];
58
+        $options = isset($options[ 'channels' ][ 'stackoverflow' ]) ? $options[ 'channels' ][ 'stackoverflow' ] : [ ];
59 59
 
60 60
         return $this->createResponse($this->manager->send($job, $options));
61 61
     }
Please login to merge, or discard this patch.
src/Entity/ApiResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     public function __call($method, $args)
62 62
     {
63 63
         $response = $this->getResponse();
64
-        $callback = [$response, $method];
64
+        $callback = [ $response, $method ];
65 65
 
66 66
         if (is_callable($callback)) {
67 67
             $returned = call_user_func_array($callback, $args);
Please login to merge, or discard this patch.
src/Service/JobsManager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,36 +64,36 @@
 block discarded – undo
64 64
         $log->info('Send Job: ' . $job->getId());
65 65
         $status = true;
66 66
 
67
-        $jobData = $job->hasAttachedEntity('stackoverflow') ? $job->getAttachedEntity('stackoverflow') : $job->createAttachedEntity(JobData::class, ['jobId' => $job->getId()], 'stackoverflow');
67
+        $jobData = $job->hasAttachedEntity('stackoverflow') ? $job->getAttachedEntity('stackoverflow') : $job->createAttachedEntity(JobData::class, [ 'jobId' => $job->getId() ], 'stackoverflow');
68 68
 
69 69
         if ($jobData->isOnline()) {
70
-            $data['action'] = 'put';
71
-            $data['externalId'] = $jobData->getExternalId();
70
+            $data[ 'action' ] = 'put';
71
+            $data[ 'externalId' ] = $jobData->getExternalId();
72 72
             $log->debug('--> Job is already online: External id ' . $jobData->getExternalId() . ': update');
73 73
         } else {
74
-            $data['action'] = 'post';
74
+            $data[ 'action' ] = 'post';
75 75
             $log->debug('--> Job is not online: insert');
76 76
         }
77 77
 
78
-        $log->debug('--> data:' , $data);
78
+        $log->debug('--> data:', $data);
79 79
         $response = $this->client->sendJob($job, $data);
80 80
 
81 81
         $apiResponse = new ApiResponse($response);
82 82
 
83
-        $result   = $response->getXml();
83
+        $result = $response->getXml();
84 84
         if ($result) {
85 85
             //$result = $result->response;
86 86
             if ('success' == $result->result) {
87 87
                 $jobData->setExternalId($result->jobid)
88 88
                         ->setExternalUrl($result->joburl)
89 89
                         ->setIsOnline(true);
90
-                $log->info('==> Successfully send ' . $job->getId(), ['id' => $result->jobid, 'url' => $result->joburl]);
90
+                $log->info('==> Successfully send ' . $job->getId(), [ 'id' => $result->jobid, 'url' => $result->joburl ]);
91 91
 
92 92
             } else {
93 93
                 $status = false;
94 94
                 $log->err('==> Sending job ' . $job->getId() . ' failed.');
95 95
                 $errors = (array) $result->errors->error;
96
-                $log->debug($response->getStatusCode() . ': ' . $response->getReasonPhrase(), ['errors' => $errors, 'body' => $response->getBody()]);
96
+                $log->debug($response->getStatusCode() . ': ' . $response->getReasonPhrase(), [ 'errors' => $errors, 'body' => $response->getBody() ]);
97 97
             }
98 98
         } else {
99 99
             $status = false;
Please login to merge, or discard this patch.
src/Client/DataTransformer.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      *
118 118
      * @return string
119 119
      */
120
-    public function transform(JobInterface $job, $options = [])
120
+    public function transform(JobInterface $job, $options = [ ])
121 121
     {
122 122
         $applyUrl = $this->getApplyUrlHelper();
123 123
         $serverUrl = $this->getServerUrlHelper();
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
         $xml->addChild('test', 'true');
133 133
 
134 134
 
135
-        $xml->addChild('action', isset($options['action']) ? $options['action'] : 'post');
135
+        $xml->addChild('action', isset($options[ 'action' ]) ? $options[ 'action' ] : 'post');
136 136
 
137
-        if (isset($options['externalId'])) {
138
-            $xml->addChild('jobid', $options['externalId']);
137
+        if (isset($options[ 'externalId' ])) {
138
+            $xml->addChild('jobid', $options[ 'externalId' ]);
139 139
         }
140 140
 
141 141
         $xml->addChild('title', $job->getTitle());
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         } else if ($atsMode->isUri()) {
161 161
             $xml->addChild('howtoapply', $atsMode->getUri());
162 162
         } else if (is_callable($applyUrl) && $serverUrl) {
163
-            $xml->addChild('howtoapply', $serverUrl($applyUrl($job, ['linkOnly' => true, 'absolute' => true])));
163
+            $xml->addChild('howtoapply', $serverUrl($applyUrl($job, [ 'linkOnly' => true, 'absolute' => true ])));
164 164
         } else {
165 165
             $xml->addChild('howtoapply', 'postalisch');
166 166
         }
@@ -176,49 +176,49 @@  discard block
 block discarded – undo
176 176
                 $coords = $location->getCoordinates();
177 177
                 if (CoordinatesInterface::TYPE_POINT == $coords->getType()) {
178 178
                     $c = $coords->getCoordinates();
179
-                    $l->addAttribute('lon', $c[0]);
180
-                    $l->addAttribute('lat', $c[1]);
179
+                    $l->addAttribute('lon', $c[ 0 ]);
180
+                    $l->addAttribute('lat', $c[ 1 ]);
181 181
                 }
182 182
             }
183 183
         }
184 184
 
185
-        foreach (['topspot', 'featured', 'remote', 'relocation', 'visasponsorship', 'sysadmin'] as $boolOpt) {
186
-            if (isset($options[$boolOpt])) {
187
-                $xml->addChild($boolOpt, $options[$boolOpt] ? 'true' : 'false');
185
+        foreach ([ 'topspot', 'featured', 'remote', 'relocation', 'visasponsorship', 'sysadmin' ] as $boolOpt) {
186
+            if (isset($options[ $boolOpt ])) {
187
+                $xml->addChild($boolOpt, $options[ $boolOpt ] ? 'true' : 'false');
188 188
             }
189 189
         }
190 190
 
191
-        foreach (['length', 'coupon', 'pixel'] as $strOpt) {
192
-            if (isset($options[$strOpt])) {
193
-                $xml->addChild($strOpt, $options[$strOpt]);
191
+        foreach ([ 'length', 'coupon', 'pixel' ] as $strOpt) {
192
+            if (isset($options[ $strOpt ])) {
193
+                $xml->addChild($strOpt, $options[ $strOpt ]);
194 194
             }
195 195
         }
196 196
 
197
-        $xml->addChild('description', html_entity_decode($job->getTemplateValues()->getDescription())  ?: '<p></p>');
197
+        $xml->addChild('description', html_entity_decode($job->getTemplateValues()->getDescription()) ?: '<p></p>');
198 198
 
199 199
         if ($requirements = $job->getTemplateValues()->getRequirements()) {
200 200
             $xml->addChild('requirements', $requirements);
201 201
         }
202 202
 
203 203
         $tags = $xml->addChild('tags');
204
-        if (isset($options['keywords']) && is_array($options['keyword'])) {
205
-            foreach ($options['keywords'] as $keyword) {
204
+        if (isset($options[ 'keywords' ]) && is_array($options[ 'keyword' ])) {
205
+            foreach ($options[ 'keywords' ] as $keyword) {
206 206
                 $tags->addChild('tag', $keyword);
207 207
             }
208 208
         } else {
209 209
             $tags->addChild('tag', 'none');
210 210
         }
211 211
 
212
-        if (isset($options['advertisingregions']) && is_array($options['advertisingregions'])) {
212
+        if (isset($options[ 'advertisingregions' ]) && is_array($options[ 'advertisingregions' ])) {
213 213
             $regions = $xml->addChild('advertisingregioncodes');
214
-            foreach ($options['advertisingregions'] as $adreg) {
214
+            foreach ($options[ 'advertisingregions' ] as $adreg) {
215 215
                 $regions->addChild('regioncode', $adreg);
216 216
             }
217 217
         }
218 218
 
219
-        if (isset($options['advertisingcountries']) && is_array($options['advertisingcountries'])) {
219
+        if (isset($options[ 'advertisingcountries' ]) && is_array($options[ 'advertisingcountries' ])) {
220 220
             $countries = $xml->addChild('advertisingcountrycodes');
221
-            foreach ($options['advertisingcountries'] as $adcountry) {
221
+            foreach ($options[ 'advertisingcountries' ] as $adcountry) {
222 222
                 $countries->addChild('regioncode', $adcountry);
223 223
             }
224 224
         }
Please login to merge, or discard this patch.