Completed
Pull Request — develop (#277)
by
unknown
13:23 queued 04:50
created
src/Organizations/Controller/Plugin/GetOrganizationHandler.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected $acl;
42 42
 
43
-    public function __construct(RepositoryService $repositoryService,AuthenticationService $auth, Acl $acl) {
44
-        $this->repositoryService=$repositoryService;
45
-        $this->auth=$auth;
46
-        $this->acl=$acl;
43
+    public function __construct(RepositoryService $repositoryService, AuthenticationService $auth, Acl $acl) {
44
+        $this->repositoryService = $repositoryService;
45
+        $this->auth = $auth;
46
+        $this->acl = $acl;
47 47
     }
48 48
 
49 49
     public function __invoke()
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
      * @throws UnauthorizedAccessException
60 60
      * @throws \Doctrine\ODM\MongoDB\LockException
61 61
      */
62
-    public function process(Params $params,$allowDraft = true)
62
+    public function process(Params $params, $allowDraft = true)
63 63
     {
64
-        $repositories   = $this->repositoryService;
64
+        $repositories = $this->repositoryService;
65 65
         $organizationRepository = $this->repositoryService->get('Organizations/Organization');
66 66
 
67 67
         $idFromRoute = $params('id', 0);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $user = $this->auth->getUser(); /* @var $user \Auth\Entity\UserInterface */
70 70
 
71 71
         /* @var $organizationId string */
72
-        $organizationId = empty($idFromRoute)?$idFromSubForm:$idFromRoute;
72
+        $organizationId = empty($idFromRoute) ? $idFromSubForm : $idFromRoute;
73 73
 
74 74
         $editOwnOrganization = '__my__' === $organizationId;
75 75
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             return $organization;
105 105
         }
106 106
 
107
-        $organization      = $organizationRepository->find($organizationId);
107
+        $organization = $organizationRepository->find($organizationId);
108 108
         if (!$organization) {
109 109
             throw new \RuntimeException('No Organization found with id "' . $organizationId . '"');
110 110
         }
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Controller/Plugin/InitializeJob.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function __construct(RepositoryService $repositoryService, AuthenticationService $auth, Acl $acl)
43 43
     {
44
-        $this->repositoryService=$repositoryService;
45
-        $this->auth=$auth;
46
-        $this->acl=$acl;
44
+        $this->repositoryService = $repositoryService;
45
+        $this->auth = $auth;
46
+        $this->acl = $acl;
47 47
     }
48 48
 
49 49
     public function __invoke()
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
     public function get(Params $params, $allowDraft = false)
62 62
     {
63 63
         /* @var \Jobs\Repository\Job $jobRepository */
64
-        $jobRepository  = $this->repositoryService->get('Jobs/Job');
64
+        $jobRepository = $this->repositoryService->get('Jobs/Job');
65 65
         $idFromRoute   = $params('id', 0);
66 66
         $idFromQuery   = $params->fromQuery('id', 0);
67 67
         $idFromSubForm = $params->fromPost('job', 0);
68 68
 
69
-        $id = empty($idFromRoute)? (empty($idFromQuery)?$idFromSubForm:$idFromQuery) : $idFromRoute;
69
+        $id = empty($idFromRoute) ? (empty($idFromQuery) ? $idFromSubForm : $idFromQuery) : $idFromRoute;
70 70
 
71 71
         if (empty($id) && $allowDraft) {
72 72
             $this->acl->__invoke('Jobs/Manage', 'new');
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Controller/ManageController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         if (empty($user->info->email)) {
171 171
             return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail'));
172 172
         }
173
-        $userOrg            = $user->getOrganization();
173
+        $userOrg = $user->getOrganization();
174 174
         if (!$userOrg->hasAssociation()) {
175 175
             return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany'));
176 176
         }
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
         $instanceForm       = null;
193 193
         $formErrorMessages = array();
194 194
 
195
-        if (isset($formIdentifier) &&  $request->isPost()) {
195
+        if (isset($formIdentifier) && $request->isPost()) {
196 196
             // at this point the form get instantiated and immediately accumulated
197 197
             $instanceForm = $form->getForm($formIdentifier);
198 198
             if (!isset($instanceForm)) {
199
-                throw new \RuntimeException('No form found for "' . $formIdentifier . '"');
199
+                throw new \RuntimeException('No form found for "'.$formIdentifier.'"');
200 200
             }
201 201
             // the id may be part of the postData, but it never should be altered
202 202
             $postData = $request->getPost();
@@ -250,20 +250,20 @@  discard block
 block discarded – undo
250 250
             $jobValid = false;
251 251
             $errorMessage[] = $this->translator->translate('Accept the Terms');
252 252
         }
253
-        $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]);
253
+        $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]);
254 254
         foreach ($result as $messages) {
255 255
             if (!$messages) {
256 256
                 continue;
257 257
             }
258 258
             if (!is_array($messages)) {
259
-                $messages = [ $messages ];
259
+                $messages = [$messages];
260 260
             }
261 261
 
262 262
             $errorMessage = array_merge($errorMessage, $messages);
263 263
             $jobValid = false;
264 264
         }
265 265
 
266
-        $errorMessage = '<br />' . implode('<br />', $errorMessage);
266
+        $errorMessage = '<br />'.implode('<br />', $errorMessage);
267 267
         if ($isAjax) {
268 268
             if ($instanceForm instanceof SummaryForm) {
269 269
                 $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY);
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
             } else {
272 272
                 $viewHelper = 'form';
273 273
             }
274
-            $viewHelperManager  = $serviceLocator->get('ViewHelperManager');
274
+            $viewHelperManager = $serviceLocator->get('ViewHelperManager');
275 275
             $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm);
276 276
             $viewModel = new JsonModel(
277 277
                 array(
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                     }
295 295
                 }
296 296
             } else {
297
-                $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]);
297
+                $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]);
298 298
                 // Job is deployed, some changes are now disabled
299 299
                 $form->enableAll();
300 300
             }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
             $completionLink = $this->url()->fromRoute(
304 304
                 'lang/jobs/completion',
305
-                [ 'id' => $jobEntity->getId()]
305
+                ['id' => $jobEntity->getId()]
306 306
             );
307 307
 
308 308
             $viewModel = $this->getViewModel($form);
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
         // array with differences between the last snapshot and the actual entity
438 438
         // is remains Null if there is no snapshot
439 439
         // it will be an empty array if the snapshot and the actual entity do not differ
440
-        $diff           = null;
440
+        $diff = null;
441 441
         // preliminary difference, contain all differences
442 442
         $prelDiff = $this->entitySnapshot()->diff($jobEntity);
443 443
         if (isset($prelDiff)) {
@@ -475,21 +475,21 @@  discard block
 block discarded – undo
475 475
             'lang/jobs/view',
476 476
             array(),
477 477
             array('query' =>
478
-                      array( 'id' => $jobEntity->getId()))
478
+                      array('id' => $jobEntity->getId()))
479 479
         );
480 480
 
481 481
         $approvalLink = $this->url()->fromRoute(
482 482
             'lang/jobs/approval',
483 483
             array('state' => 'approved'),
484 484
             array('query' =>
485
-                      array( 'id' => $jobEntity->getId()))
485
+                      array('id' => $jobEntity->getId()))
486 486
         );
487 487
 
488 488
         $declineLink = $this->url()->fromRoute(
489 489
             'lang/jobs/approval',
490 490
             array('state' => 'declined'),
491 491
             array('query' =>
492
-                      array( 'id' => $jobEntity->getId()))
492
+                      array('id' => $jobEntity->getId()))
493 493
         );
494 494
 
495 495
         return array('job' => $jobEntity,
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
      */
507 507
     public function deactivateAction()
508 508
     {
509
-        $user           = $this->auth->getUser();
509
+        $user = $this->auth->getUser();
510 510
 
511 511
         $jobEntity = $this->initializeJob()->get($this->params());
512 512
 
Please login to merge, or discard this patch.