Completed
Push — next ( 191339...0efc14 )
by Mathias
10:05
created
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.