@@ -25,13 +25,13 @@ |
||
| 25 | 25 | // calculate EndDate - StartDate = X Years. |
| 26 | 26 | // eg. 4.2 Years |
| 27 | 27 | |
| 28 | - $days=0; |
|
| 28 | + $days = 0; |
|
| 29 | 29 | foreach ($array as $obj) { |
| 30 | 30 | $date1 = new \DateTime($obj->getEndDate()); |
| 31 | 31 | $date2 = new \DateTime($obj->getStartDate()); |
| 32 | 32 | $interval = $date1->diff($date2); |
| 33 | - $days+=abs($interval->format('%R%a')); |
|
| 33 | + $days += abs($interval->format('%R%a')); |
|
| 34 | 34 | } |
| 35 | - return round($days/365, 1); |
|
| 35 | + return round($days / 365, 1); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $entity = $value; |
| 24 | 24 | $value = array(); |
| 25 | 25 | foreach ($entity->getSearchableProperties() as $name) { |
| 26 | - $result = $entity->{'get' .$name}(); |
|
| 26 | + $result = $entity->{'get'.$name}(); |
|
| 27 | 27 | if (is_array($result)) { |
| 28 | 28 | $value = array_merge($value, $result); |
| 29 | 29 | } else { |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | $innerPattern = StringUtils::hasPcreUnicodeSupport() |
| 49 | 49 | ? '[^\p{L}]' |
| 50 | 50 | : '[^a-z0-9ßäöü ]'; |
| 51 | - $pattern = '~' . $innerPattern . '~isu'; |
|
| 52 | - $stripPattern = '~^' . $innerPattern . '+|' . $innerPattern . '+$~isu'; |
|
| 51 | + $pattern = '~'.$innerPattern.'~isu'; |
|
| 52 | + $stripPattern = '~^'.$innerPattern.'+|'.$innerPattern.'+$~isu'; |
|
| 53 | 53 | $parts = array(); |
| 54 | 54 | $textParts = explode(' ', $string); |
| 55 | 55 | foreach ($textParts as $part) { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | public function prepareElement(FormInterface $form) |
| 146 | 146 | { |
| 147 | - $form->setAttribute('class', ($this->isMultiple() ? 'multi' : 'single') . '-file-upload'); |
|
| 147 | + $form->setAttribute('class', ($this->isMultiple() ? 'multi' : 'single').'-file-upload'); |
|
| 148 | 148 | $form->setAttribute('data-is-empty', null === $this->getValue()); |
| 149 | 149 | parent::prepareElement($form); |
| 150 | 150 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $entityName = $this->getName(); |
| 248 | 248 | |
| 249 | 249 | try { |
| 250 | - $fileEntity = $object->{"get" . $entityName}(); |
|
| 250 | + $fileEntity = $object->{"get".$entityName}(); |
|
| 251 | 251 | } catch (\OutOfBoundsException $e) { |
| 252 | 252 | return null; |
| 253 | 253 | } |
@@ -49,11 +49,11 @@ |
||
| 49 | 49 | $properties = $refl->getProperties(); |
| 50 | 50 | |
| 51 | 51 | foreach ($properties as $property) { |
| 52 | - $name = $property->getName(); |
|
| 52 | + $name = $property->getName(); |
|
| 53 | 53 | if ('_' == $name{0}) { |
| 54 | 54 | continue; |
| 55 | 55 | } |
| 56 | - $value = $rating->{'get' . $name}(); |
|
| 56 | + $value = $rating->{'get'.$name}(); |
|
| 57 | 57 | $input = array( |
| 58 | 58 | 'type' => 'Core/Rating', |
| 59 | 59 | 'name' => $name, |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | /* @var \Jobs\Entity\Job $value */ |
| 20 | 20 | $result = null; |
| 21 | - if (method_exists($value,'getTemplateValues')) { |
|
| 21 | + if (method_exists($value, 'getTemplateValues')) { |
|
| 22 | 22 | $result = $value->getTemplateValues()->getQualifications(); |
| 23 | 23 | } |
| 24 | 24 | return $result; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function extract($value) |
| 18 | 18 | { |
| 19 | 19 | $result = null; |
| 20 | - if (method_exists($value,'templateValues')) { |
|
| 20 | + if (method_exists($value, 'templateValues')) { |
|
| 21 | 21 | $result = $value->getTemplateValues()->getTitle(); |
| 22 | 22 | } |
| 23 | 23 | return $result; |
@@ -460,10 +460,10 @@ discard block |
||
| 460 | 460 | public function getLocation() |
| 461 | 461 | { |
| 462 | 462 | if (null === $this->location) { |
| 463 | - $array=[]; |
|
| 464 | - if(null != $this->locations){ |
|
| 463 | + $array = []; |
|
| 464 | + if (null != $this->locations) { |
|
| 465 | 465 | foreach ($this->locations as $location) { /* @var \Core\Entity\LocationInterface $location */ |
| 466 | - $array[]=$location->getCity(); |
|
| 466 | + $array[] = $location->getCity(); |
|
| 467 | 467 | } |
| 468 | 468 | return implode(', ', $array); |
| 469 | 469 | } |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | if ($removePermissions) { |
| 519 | 519 | $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL); |
| 520 | 520 | } |
| 521 | - $this->user=null; |
|
| 521 | + $this->user = null; |
|
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | return $this; |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | $organization = $this->organization; |
| 769 | 769 | if (is_object($organization) && $organization->getImage()) { |
| 770 | 770 | $organizationImage = $organization->getImage(); |
| 771 | - return "/file/Organizations.OrganizationImage/" . $organizationImage->getId(); |
|
| 771 | + return "/file/Organizations.OrganizationImage/".$organizationImage->getId(); |
|
| 772 | 772 | } |
| 773 | 773 | return $this->logoRef; |
| 774 | 774 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function viewAction() |
| 59 | 59 | { |
| 60 | 60 | $id = $this->params()->fromQuery('id'); |
| 61 | - $channel = $this->params()->fromRoute('channel','default'); |
|
| 61 | + $channel = $this->params()->fromRoute('channel', 'default'); |
|
| 62 | 62 | $response = $this->getResponse(); |
| 63 | 63 | /* @var \Jobs\Entity\Job $job */ |
| 64 | 64 | try { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->auth()->isAdmin() |
| 88 | 88 | ) { |
| 89 | 89 | $applicationViewModel->setTemplate('iframe/iFrameInjection'); |
| 90 | - }elseif(Status::EXPIRED == $job->getStatus() or Status::INACTIVE == $job->getStatus()) { |
|
| 90 | + }elseif (Status::EXPIRED == $job->getStatus() or Status::INACTIVE == $job->getStatus()) { |
|
| 91 | 91 | $response->setStatusCode(Response::STATUS_CODE_410); |
| 92 | 92 | $model->setTemplate('jobs/error/expired'); |
| 93 | 93 | $model->setVariables( |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | protected function editTemplateAction() |
| 116 | 116 | { |
| 117 | 117 | $id = $this->params('id'); |
| 118 | - $formIdentifier=$this->params()->fromQuery('form'); |
|
| 118 | + $formIdentifier = $this->params()->fromQuery('form'); |
|
| 119 | 119 | //$job = $this->jobRepository->find($id); |
| 120 | 120 | $job = $this->initializeJob()->get($this->params(), true, true); /* @var \Jobs\Entity\Job $job */ |
| 121 | 121 | $this->acl($job, 'edit'); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $formTemplate->setParam('id', $job->getId()); |
| 141 | 141 | $formTemplate->setParam('applyId', $job->getApplyId()); |
| 142 | - $formTemplate->setParam('snapshot', $job instanceOf JobSnapshot ? $job->getSnapshotId() : '' ); |
|
| 142 | + $formTemplate->setParam('snapshot', $job instanceOf JobSnapshot ? $job->getSnapshotId() : ''); |
|
| 143 | 143 | |
| 144 | 144 | $formTemplate->setEntity($job); |
| 145 | 145 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | $instanceForm = $formTemplate->get($formIdentifier); |
| 150 | 150 | if (!isset($instanceForm)) { |
| 151 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
| 151 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // the id is part of the postData, but it never should be altered |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | if (empty($user->getInfo()->getEmail())) { |
| 179 | 179 | return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail')); |
| 180 | 180 | } |
| 181 | - $userOrg = $user->getOrganization(); |
|
| 181 | + $userOrg = $user->getOrganization(); |
|
| 182 | 182 | if (!$userOrg->hasAssociation() || $userOrg->getOrganization()->isDraft()) { |
| 183 | 183 | return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany')); |
| 184 | 184 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
| 211 | - $viewModel = null; |
|
| 211 | + $viewModel = null; |
|
| 212 | 212 | $this->acl($jobEntity, 'edit'); |
| 213 | 213 | if ($status = $params->fromQuery('status')) { |
| 214 | 214 | $this->changeStatus($jobEntity, $status); |
@@ -220,11 +220,11 @@ discard block |
||
| 220 | 220 | $instanceForm = null; |
| 221 | 221 | $formErrorMessages = array(); |
| 222 | 222 | |
| 223 | - if (isset($formIdentifier) && $request->isPost()) { |
|
| 223 | + if (isset($formIdentifier) && $request->isPost()) { |
|
| 224 | 224 | // at this point the form get instantiated and immediately accumulated |
| 225 | 225 | $instanceForm = $form->getForm($formIdentifier); |
| 226 | 226 | if (!isset($instanceForm)) { |
| 227 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
| 227 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
| 228 | 228 | } |
| 229 | 229 | // the id may be part of the postData, but it never should be altered |
| 230 | 230 | $postData = $request->getPost(); |
@@ -278,20 +278,20 @@ discard block |
||
| 278 | 278 | $jobValid = false; |
| 279 | 279 | $errorMessage[] = $this->translator->translate('Accept the Terms'); |
| 280 | 280 | } |
| 281 | - $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]); |
|
| 281 | + $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]); |
|
| 282 | 282 | foreach ($result as $messages) { |
| 283 | 283 | if (!$messages) { |
| 284 | 284 | continue; |
| 285 | 285 | } |
| 286 | 286 | if (!is_array($messages)) { |
| 287 | - $messages = [ $messages ]; |
|
| 287 | + $messages = [$messages]; |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | $errorMessage = array_merge($errorMessage, $messages); |
| 291 | 291 | $jobValid = false; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - $errorMessage = '<br />' . implode('<br />', $errorMessage); |
|
| 294 | + $errorMessage = '<br />'.implode('<br />', $errorMessage); |
|
| 295 | 295 | if ($isAjax) { |
| 296 | 296 | if ($instanceForm instanceof SummaryForm) { |
| 297 | 297 | $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY); |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | } else { |
| 300 | 300 | $viewHelper = 'form'; |
| 301 | 301 | } |
| 302 | - $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
| 302 | + $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
| 303 | 303 | $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm); |
| 304 | 304 | $viewModel = new JsonModel( |
| 305 | 305 | array( |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | } else { |
| 325 | - $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]); |
|
| 325 | + $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]); |
|
| 326 | 326 | // Job is deployed, some changes are now disabled |
| 327 | 327 | $form->enableAll(); |
| 328 | 328 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | $completionLink = $this->url()->fromRoute( |
| 332 | 332 | 'lang/jobs/completion', |
| 333 | - [ 'id' => $jobEntity->getId()] |
|
| 333 | + ['id' => $jobEntity->getId()] |
|
| 334 | 334 | ); |
| 335 | 335 | |
| 336 | 336 | $viewModel = $this->getViewModel($form); |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | // array with differences between the last snapshot and the actual entity |
| 502 | 502 | // is remains Null if there is no snapshot |
| 503 | 503 | // it will be an empty array if the snapshot and the actual entity do not differ |
| 504 | - $diff = null; |
|
| 504 | + $diff = null; |
|
| 505 | 505 | |
| 506 | 506 | |
| 507 | 507 | if ($params == 'declined') { |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | */ |
| 561 | 561 | public function deactivateAction() |
| 562 | 562 | { |
| 563 | - $user = $this->auth->getUser(); |
|
| 563 | + $user = $this->auth->getUser(); |
|
| 564 | 564 | |
| 565 | 565 | $jobEntity = $this->initializeJob()->get($this->params()); |
| 566 | 566 | |