@@ -19,7 +19,7 @@ discard block |
||
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 |
||
64 | 64 | ], |
65 | 65 | 'lazy' => true, |
66 | 66 | ], |
67 | - ]], |
|
67 | + ] ], |
|
68 | 68 | ], |
69 | 69 | ]; |
@@ -55,7 +55,7 @@ |
||
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 | } |
@@ -61,7 +61,7 @@ |
||
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); |
@@ -64,36 +64,36 @@ |
||
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; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - public function transform(JobInterface $job, $options = []) |
|
64 | + public function transform(JobInterface $job, $options = [ ]) |
|
65 | 65 | { |
66 | 66 | $applyUrl = $this->getApplyUrlHelper(); |
67 | 67 | |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | $xml->addChild('test', 'true'); |
75 | 75 | |
76 | 76 | |
77 | - $xml->addChild('action', isset($options['action']) ? $options['action'] : 'post'); |
|
77 | + $xml->addChild('action', isset($options[ 'action' ]) ? $options[ 'action' ] : 'post'); |
|
78 | 78 | |
79 | - if (isset($options['externalId'])) { |
|
80 | - $xml->addChild('jobid', $options['externalId']); |
|
79 | + if (isset($options[ 'externalId' ])) { |
|
80 | + $xml->addChild('jobid', $options[ 'externalId' ]); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $xml->addChild('title', $job->getTitle()); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } else if ($atsMode->isUri()) { |
102 | 102 | $xml->addChild('howtoapply', $atsMode->getUri()); |
103 | 103 | } else if (is_callable($applyUrl)) { |
104 | - $xml->addChild('howtoapply', $applyUrl($job, ['linkOnly' => true, 'absolute' => true])); |
|
104 | + $xml->addChild('howtoapply', $applyUrl($job, [ 'linkOnly' => true, 'absolute' => true ])); |
|
105 | 105 | } else { |
106 | 106 | $xml->addChild('howtoapply', 'postalisch'); |
107 | 107 | } |
@@ -117,49 +117,49 @@ discard block |
||
117 | 117 | $coords = $location->getCoordinates(); |
118 | 118 | if (CoordinatesInterface::TYPE_POINT == $coords->getType()) { |
119 | 119 | $c = $coords->getCoordinates(); |
120 | - $l->addAttribute('lon', $c[0]); |
|
121 | - $l->addAttribute('lat', $c[1]); |
|
120 | + $l->addAttribute('lon', $c[ 0 ]); |
|
121 | + $l->addAttribute('lat', $c[ 1 ]); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | - foreach (['topspot', 'featured', 'remote', 'relocation', 'visasponsorship', 'sysadmin'] as $boolOpt) { |
|
127 | - if (isset($options[$boolOpt])) { |
|
128 | - $xml->addChild($boolOpt, $options[$boolOpt] ? 'true' : 'false'); |
|
126 | + foreach ([ 'topspot', 'featured', 'remote', 'relocation', 'visasponsorship', 'sysadmin' ] as $boolOpt) { |
|
127 | + if (isset($options[ $boolOpt ])) { |
|
128 | + $xml->addChild($boolOpt, $options[ $boolOpt ] ? 'true' : 'false'); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
132 | - foreach (['length', 'coupon', 'pixel'] as $strOpt) { |
|
133 | - if (isset($options[$strOpt])) { |
|
134 | - $xml->addChild($strOpt, $options[$strOpt]); |
|
132 | + foreach ([ 'length', 'coupon', 'pixel' ] as $strOpt) { |
|
133 | + if (isset($options[ $strOpt ])) { |
|
134 | + $xml->addChild($strOpt, $options[ $strOpt ]); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - $xml->addChild('description', $job->getTemplateValues()->getDescription() ?: '<p>Porta magna lectus architect evangelist. Monad dolores unibody gubergren combinator VC. NoSQL viral pre-IPO disruptive in event-driven vel :). Exploit monkey patch gubergren functional agile. Consetetur justo architect async crowdfunding eos usability! Kasd massa dolores tincidunt web-scale vesting schedule diam :). Et stet in agile.</p>'); |
|
138 | + $xml->addChild('description', $job->getTemplateValues()->getDescription() ?: '<p>Porta magna lectus architect evangelist. Monad dolores unibody gubergren combinator VC. NoSQL viral pre-IPO disruptive in event-driven vel :). Exploit monkey patch gubergren functional agile. Consetetur justo architect async crowdfunding eos usability! Kasd massa dolores tincidunt web-scale vesting schedule diam :). Et stet in agile.</p>'); |
|
139 | 139 | |
140 | 140 | if ($requirements = $job->getTemplateValues()->getRequirements()) { |
141 | 141 | $xml->addChild('requirements', $requirements); |
142 | 142 | } |
143 | 143 | |
144 | 144 | $tags = $xml->addChild('tags'); |
145 | - if (isset($options['keywords']) && is_array($options['keyword'])) { |
|
146 | - foreach ($options['keywords'] as $keyword) { |
|
145 | + if (isset($options[ 'keywords' ]) && is_array($options[ 'keyword' ])) { |
|
146 | + foreach ($options[ 'keywords' ] as $keyword) { |
|
147 | 147 | $tags->addChild('tag', $keyword); |
148 | 148 | } |
149 | 149 | } else { |
150 | 150 | $tags->addChild('tag', 'none'); |
151 | 151 | } |
152 | 152 | |
153 | - if (isset($options['advertisingregions']) && is_array($options['advertisingregions'])) { |
|
153 | + if (isset($options[ 'advertisingregions' ]) && is_array($options[ 'advertisingregions' ])) { |
|
154 | 154 | $regions = $xml->addChild('advertisingregioncodes'); |
155 | - foreach ($options['advertisingregions'] as $adreg) { |
|
155 | + foreach ($options[ 'advertisingregions' ] as $adreg) { |
|
156 | 156 | $regions->addChild('regioncode', $adreg); |
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | - if (isset($options['advertisingcountries']) && is_array($options['advertisingcountries'])) { |
|
160 | + if (isset($options[ 'advertisingcountries' ]) && is_array($options[ 'advertisingcountries' ])) { |
|
161 | 161 | $countries = $xml->addChild('advertisingcountrycodes'); |
162 | - foreach ($options['advertisingcountries'] as $adcountry) { |
|
162 | + foreach ($options[ 'advertisingcountries' ] as $adcountry) { |
|
163 | 163 | $countries->addChild('regioncode', $adcountry); |
164 | 164 | } |
165 | 165 | } |