Completed
Push — develop ( 06c328...a78ff6 )
by Carsten
17:00 queued 08:38
created
module/Core/src/Core/Controller/FileController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $response      = $this->getResponse();
74 74
 
75 75
         try {
76
-            $repository = $this->repositories->get($module . '/' . $entityName);
76
+            $repository = $this->repositories->get($module.'/'.$entityName);
77 77
         } catch (\Exception $e) {
78 78
             $response->setStatusCode(404);
79 79
             $this->getEvent()->setParam('exception', $e);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         
108 108
         $this->acl($file);
109 109
 
110
-        $headers=$response->getHeaders();
110
+        $headers = $response->getHeaders();
111 111
 
112 112
         $headers->addHeaderline('Content-Type', $file->getType())
113 113
             ->addHeaderline('Content-Length', $file->getLength());
Please login to merge, or discard this patch.
module/Core/src/Core/Factory/Controller/FileControllerFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
         $repositories = $container->get('repositories');
27 27
         $coreFileEvents = $container->get('Core/File/Events');
28 28
 
29
-        return new FileController($repositories,$coreFileEvents);
29
+        return new FileController($repositories, $coreFileEvents);
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
module/Behat/src/OrganizationContext.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
 	public function iHaveOrganization($name)
104 104
     {
105 105
         $user = $this->getUserContext()->getCurrentUser();
106
-        $organization = $this->findOrganizationByName($name,false);
106
+        $organization = $this->findOrganizationByName($name, false);
107 107
         $repo = $this->getRepository('Organizations/Organization');
108
-        if(!$organization instanceof Organization){
108
+        if (!$organization instanceof Organization) {
109 109
 
110 110
             $organization = new Organization();
111 111
             $organizationName = new OrganizationName($name);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         $organization->setParent($parent);
119 119
         $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE);
120 120
         $permissions = $organization->getPermissions();
121
-        $permissions->grant($user,Permissions::PERMISSION_ALL);
121
+        $permissions->grant($user, Permissions::PERMISSION_ALL);
122 122
 
123 123
         $repo->store($organization);
124 124
         $repo->getDocumentManager()->refresh($organization);
@@ -128,19 +128,19 @@  discard block
 block discarded – undo
128 128
     /**
129 129
      * @Given organization :name have jobs:
130 130
      */
131
-    public function organizationHavePublishedJob($name,TableNode $table)
131
+    public function organizationHavePublishedJob($name, TableNode $table)
132 132
     {
133 133
         $user = $this->getUserContext()->getCurrentUser();
134
-        if(is_null($user)){
134
+        if (is_null($user)) {
135 135
             throw new FailedExpectationException('Need to login first');
136 136
         }
137 137
 
138 138
         $organization = $this->findOrganizationByName($name);
139
-        foreach($table->getColumnsHash() as $index=>$definitions){
139
+        foreach ($table->getColumnsHash() as $index=>$definitions) {
140 140
             $definitions['user'] = $user->getLogin();
141
-            $status = isset($definitions['status']) ? $definitions['status']:'draft';
141
+            $status = isset($definitions['status']) ? $definitions['status'] : 'draft';
142 142
             unset($definitions['status']);
143
-            $this->jobContext->buildJob($status,$definitions,$organization);
143
+            $this->jobContext->buildJob($status, $definitions, $organization);
144 144
         }
145 145
     }
146 146
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      * @param $name
150 150
      * @param $setting
151 151
      */
152
-    public function profileSetting($name,$setting)
152
+    public function profileSetting($name, $setting)
153 153
     {
154 154
         $repo = $this->getRepository('Organizations/Organization');
155 155
         $organization = $this->findOrganizationByName($name);
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
         $contact = $organization->getContact();
170 170
 
171 171
         $definitions = $table->getRowsHash();
172
-        foreach($definitions as $name=>$value){
172
+        foreach ($definitions as $name=>$value) {
173 173
             $field = Inflector::camelize($name);
174 174
             $method = 'set'.$field;
175
-            $callback = array($contact,$method);
176
-            if(is_callable($callback)){
177
-                call_user_func_array($callback,[$value]);
175
+            $callback = array($contact, $method);
176
+            if (is_callable($callback)) {
177
+                call_user_func_array($callback, [$value]);
178 178
             }
179 179
         }
180 180
         $this->getRepository('Organizations/Organization')->store($organization);
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
      * @param string $name
187 187
      * @throws FailedExpectationException
188 188
      */
189
-    public function iGoToOrganizationProfilePage($name=null)
189
+    public function iGoToOrganizationProfilePage($name = null)
190 190
     {
191
-        if(is_null($name)){
191
+        if (is_null($name)) {
192 192
             $organization = $this->getUserContext()->getCurrentUser()->getOrganization()->getOrganization();
193
-        }else{
193
+        } else {
194 194
             $organization = $this->findOrganizationByName($name);
195 195
         }
196
-        $url = $this->buildUrl('lang/organizations/profileDetail',[
196
+        $url = $this->buildUrl('lang/organizations/profileDetail', [
197 197
             'id' => $organization->getId()
198 198
         ]);
199 199
 
@@ -210,10 +210,10 @@  discard block
 block discarded – undo
210 210
         /* @var OrganizationRepository $repo */
211 211
         $repo = $this->getRepository('Organizations/Organization');
212 212
         $result = $repo->findByName($name);
213
-        $organization = count($result) > 0 ? $result[0]:null;
214
-        if(!$organization instanceof Organization && $throwException){
213
+        $organization = count($result) > 0 ? $result[0] : null;
214
+        if (!$organization instanceof Organization && $throwException) {
215 215
             throw new FailedExpectationException(
216
-                sprintf('Organization %s is not found.',$name)
216
+                sprintf('Organization %s is not found.', $name)
217 217
             );
218 218
         }
219 219
         return $organization;
@@ -232,8 +232,8 @@  discard block
 block discarded – undo
232 232
         $jobRepo = $this->getRepository('Jobs/Job');
233 233
         $result = $jobRepo->findByOrganization($org->getId());
234 234
 
235
-        foreach($result as $job){
236
-            $jobRepo->remove($job,true);
235
+        foreach ($result as $job) {
236
+            $jobRepo->remove($job, true);
237 237
         }
238 238
     }
239 239
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
     {
245 245
         $user = $this->getUserContext()->getCurrentUser();
246 246
         $organization = $user->getOrganization()->getOrganization();
247
-        $url = $this->buildUrl('lang/organizations/edit',['id' => $organization->getId()]);
247
+        $url = $this->buildUrl('lang/organizations/edit', ['id' => $organization->getId()]);
248 248
         $this->visit($url);
249 249
     }
250 250
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     public function iAttachLogoFromFile($file)
256 256
     {
257 257
         $elementId = 'organizationLogo-original';
258
-        $this->minkContext->attachFileToField($elementId,$file);
258
+        $this->minkContext->attachFileToField($elementId, $file);
259 259
     }
260 260
 
261 261
     /**
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     public function iRemoveLogoFromOrganization()
265 265
     {
266 266
         $elementId = '#organizationLogo-original-delete';
267
-        $element = $this->minkContext->getSession()->getPage()->find('css',$elementId);
267
+        $element = $this->minkContext->getSession()->getPage()->find('css', $elementId);
268 268
         $element->click();
269 269
     }
270 270
 }
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Controller/ProfileController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
 
84 84
         $result = $this->pagination([
85
-            'params' => ['Organizations_Profile',[
85
+            'params' => ['Organizations_Profile', [
86 86
                     'q',
87 87
                     'count' => $this->options['count'],
88 88
                     'page' => 1,
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $repo            = $this->repo;
117 117
         $id              = $this->params('id');
118 118
 
119
-        if(is_null($id)){
119
+        if (is_null($id)) {
120 120
             $this->getResponse()->setStatusCode(Response::STATUS_CODE_404);
121 121
             return [
122 122
                 'message' => $translator->translate('Can not access profile page without id'),
@@ -125,20 +125,20 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
         $organization = $repo->find($id);
128
-        if(!$organization instanceof Organization){
128
+        if (!$organization instanceof Organization) {
129 129
             throw new NotFoundException($id);
130 130
         }
131 131
 
132
-        if(
132
+        if (
133 133
             Organization::PROFILE_DISABLED == $organization->getProfileSetting()
134 134
             || is_null($organization->getProfileSetting())
135
-        ){
135
+        ) {
136 136
             throw new UnauthorizedAccessException(/*@translate*/ 'This Organization Profile is disabled');
137 137
         }
138 138
 
139 139
         $result = $this->pagination([
140 140
             'params' => [
141
-                'Organization_Jobs',[
141
+                'Organization_Jobs', [
142 142
                     'q',
143 143
                     'organization_id' => $id,
144 144
                     'count' => $this->options['count'],
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
             ],
152 152
         ]);
153 153
 
154
-        if(
154
+        if (
155 155
             Organization::PROFILE_ACTIVE_JOBS == $organization->getProfileSetting()
156
-        ){
156
+        ) {
157 157
             /* @var \Zend\Paginator\Paginator $paginator */
158 158
             $paginator = $result['jobs'];
159 159
             $count = $paginator->getTotalItemCount();
160
-            if(0===$count){
160
+            if (0 === $count) {
161 161
                 throw new UnauthorizedAccessException($this->translator->translate('This Organization Profile is disabled'));
162 162
             }
163 163
         }
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Listener/MailSender.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $this->options = array_merge($this->options, $options);
63 63
     }
64 64
 
65
-    public function attach(EventManagerInterface $events, $priority=1)
65
+    public function attach(EventManagerInterface $events, $priority = 1)
66 66
     {
67 67
         $this->listeners[] = $events->attach(JobEvent::EVENT_JOB_CREATED, array($this, 'onJobCreated'));
68 68
         $this->listeners[] = $events->attach(JobEvent::EVENT_JOB_ACCEPTED, array($this, 'onJobAccepted'));
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         if ($adminMail) {
153 153
             $mail->setTo($this->options['adminEmail']);
154 154
         } else {
155
-            if (! ($user = $job->getUser()) ) { return; }
155
+            if (!($user = $job->getUser())) { return; }
156 156
             $userInfo  = $user->getInfo();
157 157
             $userEmail = $userInfo->getEmail();
158 158
             $userName  = $userInfo->getDisplayName(/*emailIfEmpty*/ false);
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Controller/ManageController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
     protected function save()
228 228
     {
229 229
 		$formEvents = $this->jobFormEvents;
230
-        $user               = $this->auth->getUser();
230
+        $user = $this->auth->getUser();
231 231
         if (empty($user->getInfo()->getEmail())) {
232 232
             return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail'));
233 233
         }
234
-        $userOrg            = $user->getOrganization();
234
+        $userOrg = $user->getOrganization();
235 235
         if (!$userOrg->hasAssociation() || $userOrg->getOrganization()->isDraft()) {
236 236
             return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany'));
237 237
         }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         }
262 262
 
263 263
 
264
-        $viewModel          = null;
264
+        $viewModel = null;
265 265
         $this->acl($jobEntity, 'edit');
266 266
         if ($status = $params->fromQuery('status')) {
267 267
             $this->changeStatus($jobEntity, $status);
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
         $instanceForm       = null;
274 274
         $formErrorMessages = array();
275 275
 
276
-        if (isset($formIdentifier) &&  $request->isPost()) {
276
+        if (isset($formIdentifier) && $request->isPost()) {
277 277
             // at this point the form get instantiated and immediately accumulated
278 278
             $instanceForm = $form->getForm($formIdentifier);
279 279
             if (!isset($instanceForm)) {
280
-                throw new \RuntimeException('No form found for "' . $formIdentifier . '"');
280
+                throw new \RuntimeException('No form found for "'.$formIdentifier.'"');
281 281
             }
282 282
             // the id may be part of the postData, but it never should be altered
283 283
             $postData = $request->getPost();
@@ -331,20 +331,20 @@  discard block
 block discarded – undo
331 331
             $jobValid = false;
332 332
             $errorMessage[] = $this->translator->translate('Accept the Terms');
333 333
         }
334
-        $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]);
334
+        $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]);
335 335
         foreach ($result as $messages) {
336 336
             if (!$messages) {
337 337
                 continue;
338 338
             }
339 339
             if (!is_array($messages)) {
340
-                $messages = [ $messages ];
340
+                $messages = [$messages];
341 341
             }
342 342
 
343 343
             $errorMessage = array_merge($errorMessage, $messages);
344 344
             $jobValid = false;
345 345
         }
346 346
 
347
-        $errorMessage = '<br />' . implode('<br />', $errorMessage);
347
+        $errorMessage = '<br />'.implode('<br />', $errorMessage);
348 348
         if ($isAjax) {
349 349
             if ($instanceForm instanceof SummaryForm) {
350 350
                 $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY);
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             } else {
353 353
                 $viewHelper = 'form';
354 354
             }
355
-            $viewHelperManager  = $this->viewHelper;
355
+            $viewHelperManager = $this->viewHelper;
356 356
             $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm);
357 357
             $viewModel = new JsonModel(
358 358
                 array(
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                     }
377 377
                 }
378 378
             } else {
379
-                $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]);
379
+                $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]);
380 380
                 // Job is deployed, some changes are now disabled
381 381
                 $form->enableAll();
382 382
             }
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
             $completionLink = $this->url()->fromRoute(
386 386
                 'lang/jobs/completion',
387
-                [ 'id' => $jobEntity->getId()]
387
+                ['id' => $jobEntity->getId()]
388 388
             );
389 389
 
390 390
             $viewModel = $this->getViewModel($form);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
     protected function getFormular($job)
451 451
     {
452 452
         /* @var $forms \Zend\Form\FormElementManager\FormElementManagerV3Polyfill */
453
-        $forms    = $this->formManager;
453
+        $forms = $this->formManager;
454 454
         /* @var $container \Jobs\Form\Job */
455 455
 
456 456
         $container = $forms->get(
@@ -552,15 +552,15 @@  discard block
 block discarded – undo
552 552
         $jobEvent->setJobEntity($jobEntity);
553 553
         $jobEvent->addPortal('XingVendorApi');
554 554
         $jobEvent->setTarget($this);
555
-        $jobEvents      = $this->jobEvents;
555
+        $jobEvents = $this->jobEvents;
556 556
         // array with differences between the last snapshot and the actual entity
557 557
         // is remains Null if there is no snapshot
558 558
         // it will be an empty array if the snapshot and the actual entity do not differ
559
-        $diff           = null;
559
+        $diff = null;
560 560
 
561 561
 
562 562
         if ($params == 'declined') {
563
-            if ($jobEntity instanceOf JobSnapshot)  {
563
+            if ($jobEntity instanceOf JobSnapshot) {
564 564
                 $jobEntity->getOriginalEntity()->changeStatus(
565 565
                     Status::ACTIVE,
566 566
                     sprintf(
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
      */
639 639
     public function deactivateAction()
640 640
     {
641
-        $user           = $this->auth->getUser();
641
+        $user = $this->auth->getUser();
642 642
 
643 643
         $jobEntity = $this->initializeJob()->get($this->params());
644 644
 
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Controller/ConsoleController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
         }
56 56
 
57 57
         $date = new \DateTime('today');
58
-        $date->sub(new \DateInterval('P' . $days . 'D'));
58
+        $date->sub(new \DateInterval('P'.$days.'D'));
59 59
 
60
-        $query        = [
60
+        $query = [
61 61
             '$and' => [
62 62
                 ['status.name' => StatusInterface::ACTIVE],
63 63
                 ['$or' => [
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         $offset = 0;
75 75
         if ($limit && false !== strpos($limit, ',')) {
76
-            list($limit,$offset) = explode(',', $limit);
76
+            list($limit, $offset) = explode(',', $limit);
77 77
         }
78 78
 
79 79
         $jobs = $jobsRepo->findBy($query, null, (int) $limit, (int) $offset);
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
         }
85 85
 
86 86
         if ($info) {
87
-            echo count($jobs) , ' Jobs';
88
-            if ($offset) { echo ' starting from ' . $offset; }
89
-            echo PHP_EOL . PHP_EOL;
87
+            echo count($jobs), ' Jobs';
88
+            if ($offset) { echo ' starting from '.$offset; }
89
+            echo PHP_EOL.PHP_EOL;
90 90
             $this->listExpiredJobs($jobs);
91 91
             return;
92 92
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 //
98 98
         echo "$count jobs found, which have to expire ...\n";
99 99
         
100
-        $progress     = new ProgressBar(
100
+        $progress = new ProgressBar(
101 101
             new ConsoleAdapter(
102 102
                 array(
103 103
                 'elements' => array(
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         /* @var \Jobs\Entity\Job $job */
122 122
         foreach ($jobs as $job) {
123
-            $progress->update($i++, 'Job ' . $i . ' / ' . $count);
123
+            $progress->update($i++, 'Job '.$i.' / '.$count);
124 124
 
125 125
             $job->changeStatus('expired');
126 126
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         $i            = 0;
149 149
         /* @var Job $job */
150 150
         foreach ($jobs as $job) {
151
-            $progress->update($i++, 'Job ' . $i . ' / ' . $count);
151
+            $progress->update($i++, 'Job '.$i.' / '.$count);
152 152
             
153 153
             $permissions = $job->getPermissions();
154 154
             $user        = $job->getUser();
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 continue;
157 157
             }
158 158
             try {
159
-                $group       = $user->getGroup($job->getCompany());
159
+                $group = $user->getGroup($job->getCompany());
160 160
             } catch (\Exception $e) {
161 161
                 continue;
162 162
             }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                 $org = $job->getCompany();
196 196
             }
197 197
             printf(
198
-                '%s   %s   %s   %-30s   %-20s' . PHP_EOL,
198
+                '%s   %s   %s   %-30s   %-20s'.PHP_EOL,
199 199
                 $id,
200 200
                 $job->getDatePublishStart()->format('Y-m-d'),
201 201
                 $job->getDatePublishEnd()->format('Y-m-d'),
@@ -203,6 +203,6 @@  discard block
 block discarded – undo
203 203
                 substr($org, 0, 20)
204 204
             );
205 205
         }
206
-        return count($jobs) . ' Jobs.';
206
+        return count($jobs).' Jobs.';
207 207
     }
208 208
 }
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Entity/Job.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -513,10 +513,10 @@  discard block
 block discarded – undo
513 513
     public function getLocation()
514 514
     {
515 515
         if (null === $this->location) {
516
-            $array=[];
517
-            if(null != $this->locations){
516
+            $array = [];
517
+            if (null != $this->locations) {
518 518
                 foreach ($this->locations as $location) { /* @var \Core\Entity\LocationInterface $location */
519
-                    $array[]=(string) $location;
519
+                    $array[] = (string) $location;
520 520
                 }
521 521
                 return implode(', ', $array);
522 522
             }
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
             if ($removePermissions) {
572 572
                 $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL);
573 573
             }
574
-            $this->user=null;
574
+            $this->user = null;
575 575
         }
576 576
 
577 577
         return $this;
@@ -579,8 +579,8 @@  discard block
 block discarded – undo
579 579
 
580 580
     public function unsetOrganization($removePermissions = true)
581 581
     {
582
-        if($this->organization && $removePermissions){
583
-            $this->getPermissions()->revoke($this->organization,Permissions::PERMISSION_ALL);
582
+        if ($this->organization && $removePermissions) {
583
+            $this->getPermissions()->revoke($this->organization, Permissions::PERMISSION_ALL);
584 584
         }
585 585
 
586 586
         $this->organization = null;
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
         $organization = $this->organization;
833 833
         if (is_object($organization) && $organization->getImage()) {
834 834
             $organizationImage = $organization->getImage();
835
-            return "/file/Organizations.OrganizationImage/" . $organizationImage->getId();
835
+            return "/file/Organizations.OrganizationImage/".$organizationImage->getId();
836 836
         }
837 837
         return $this->logoRef;
838 838
     }
Please login to merge, or discard this patch.