Completed
Pull Request — develop (#228)
by ANTHONIUS
08:32
created
module/Core/src/Core/Factory/EventManager/EventManagerAbstractFactory.php 4 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@
 block discarded – undo
54 54
         if (method_exists($events, 'setEventPrototype')) {
55 55
             $event = $serviceLocator->has($config['event']) ? $serviceLocator->get($config['event']) : new $config['event']();
56 56
             $events->setEventPrototype($event);
57
-        }
58
-        else {
57
+        } else {
59 58
             $events->setEventClass($config['event']);
60 59
         }
61 60
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@
 block discarded – undo
293 293
      * @param string|array $options String is either event name or aggregate name (when name is int).
294 294
      *                              Array are the options from config. [ [event,..], method, priority, lazy]
295 295
      *
296
-     * @return array
296
+     * @return \Zend\EventManager\EventManagerInterface
297 297
      */
298 298
     protected function normalizeListenerOptions($name, $options)
299 299
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@
 block discarded – undo
278 278
             /* @var \Core\Listener\DeferredListenerAggregate $aggregate */
279 279
             $aggregate = $services->get('Core/Listener/DeferredListenerAggregate');
280 280
             $aggregate->setListeners($lazyListeners)
281
-                      ->attach($eventManager);
281
+                        ->attach($eventManager);
282 282
         }
283 283
     }
284 284
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         $defaults = [
149 149
             'service' => 'EventManager',
150 150
             'configure' => true,
151
-            'identifiers' => [ $name ],
151
+            'identifiers' => [$name],
152 152
             'event' => '\Zend\EventManager\Event',
153 153
             'listeners' => [],
154 154
         ];
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         foreach ($listeners as $name => $options) {
240 240
             $options = $this->normalizeListenerOptions($name, $options);
241 241
 
242
-            if ($options['lazy'] && null !== $options['attach'] ) {
242
+            if ($options['lazy'] && null !== $options['attach']) {
243 243
                 foreach ($options['attach'] as $spec) {
244 244
                     $lazyListeners[] = [
245 245
                         'service' => $options['service'],
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             }
270 270
 
271 271
             foreach ($options['attach'] as $spec) {
272
-                $callback = $spec['method'] ? [ $listener, $spec['method'] ] : $listener;
272
+                $callback = $spec['method'] ? [$listener, $spec['method']] : $listener;
273 273
                 $eventManager->attach($spec['events'], $callback, $spec['priority']);
274 274
             }
275 275
         }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
         if (is_string($options)) {
342 342
             /* Only an event name is provided in config */
343
-            $normalized['attach'] = [ [ 'events' => [ $options ], 'method' => null, 'priority' => 0 ] ];
343
+            $normalized['attach'] = [['events' => [$options], 'method' => null, 'priority' => 0]];
344 344
             return $normalized;
345 345
 
346 346
         }
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             } else if (is_string($opt)) {
370 370
                 if (null === $event) {
371 371
                     /* first string found is assumed to be the event name */
372
-                    $event = [ $opt ];
372
+                    $event = [$opt];
373 373
                 } else {
374 374
                     /* second string found must be a method name. */
375 375
                     $method = $opt;
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
             }
386 386
         }
387 387
 
388
-        $normalized['attach'] = [ [ 'events' => $event, 'method' => $method, 'priority' => $priority ] ];
388
+        $normalized['attach'] = [['events' => $event, 'method' => $method, 'priority' => $priority]];
389 389
         $normalized['lazy']   = $lazy;
390 390
 
391 391
         return $normalized;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
     protected function normalizeEventsSpec($options)
395 395
     {
396 396
         $listenerPriority = isset($options['priority']) ? $options['priority'] : 0;
397
-        $listenerMethod   = isset($options['method'])   ? $options['method']   : '__none__';
397
+        $listenerMethod   = isset($options['method']) ? $options['method'] : '__none__';
398 398
         $events = [];
399 399
 
400 400
         foreach ($options['events'] as $event => $spec) {
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
             } else if (is_array($spec)) {
415 415
                 if (isset($spec['method'])) {
416 416
                     if (!is_array($spec['method'])) {
417
-                        $spec['method'] = [ $spec['method'] ];
417
+                        $spec['method'] = [$spec['method']];
418 418
                     }
419 419
 
420 420
                     foreach ($spec['method'] as $method => $methodPriority) {
Please login to merge, or discard this patch.
module/Orders/config/router.config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @license MIT
7 7
  * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8 8
  */
9
-return [ 'router' => [ 'routes' => [ 'lang' => [ 'child_routes' => [
9
+return ['router' => ['routes' => ['lang' => ['child_routes' => [
10 10
 
11 11
     'orders' => [
12 12
         'type' => 'Segment',
Please login to merge, or discard this patch.
module/Orders/config/module.config.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,4 +60,4 @@
 block discarded – undo
60 60
         ],
61 61
     ],
62 62
 ];
63
-  
64 63
\ No newline at end of file
64
+    
65 65
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
                  * for multiple paths.
24 24
                  * example https://github.com/doctrine/DoctrineORMModule
25 25
                  */
26
-                'paths' => array( __DIR__ . '/../src/Entity'),
26
+                'paths' => array(__DIR__.'/../src/Entity'),
27 27
             ),
28 28
         ],
29 29
     ],
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         'translation_file_patterns' => array(
34 34
             array(
35 35
                 'type'     => 'gettext',
36
-                'base_dir' => __DIR__ . '/../language',
36
+                'base_dir' => __DIR__.'/../language',
37 37
                 'pattern'  => '%s.mo',
38 38
             ),
39 39
         ),
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 
43 43
     'event_manager' => [
44 44
 
45
-        'Jobs/Events' => [ 'listeners' => [
46
-            'Orders/Listener/CreateJobOrder' => [ \Jobs\Listener\Events\JobEvent::EVENT_JOB_CREATED, true ],
45
+        'Jobs/Events' => ['listeners' => [
46
+            'Orders/Listener/CreateJobOrder' => [\Jobs\Listener\Events\JobEvent::EVENT_JOB_CREATED, true],
47 47
         ]],
48 48
 
49
-        'Jobs/JobContainer/Events' => [ 'listeners' => [
49
+        'Jobs/JobContainer/Events' => ['listeners' => [
50 50
             '\Orders\Form\Listener\DisableJobInvoiceAddress' => 'DisableElements',
51 51
             'Orders\Form\Listener\InjectInvoiceAddressInJobContainer' => \Core\Form\Event\FormEvent::EVENT_INIT,
52 52
             '\Orders\Form\Listener\ValidateJobInvoiceAddress' => 'ValidateJob',
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             ],
60 60
         ],
61 61
 
62
-        'Core/AdminController/Events' => [ 'listeners' => [
62
+        'Core/AdminController/Events' => ['listeners' => [
63 63
             'Orders/Listener/AdminWidgetProvider' => \Core\Controller\AdminControllerEvent::EVENT_DASHBOARD,
64 64
         ]],
65 65
     ],
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     'view_helper_config' => [
83 83
         'headscript' => [
84 84
             'lang/orders' => [
85
-                [ \Zend\View\Helper\HeadScript::FILE, 'Orders/js/list.index.js', 'PREPEND' ],
85
+                [\Zend\View\Helper\HeadScript::FILE, 'Orders/js/list.index.js', 'PREPEND'],
86 86
                 'js/bootstrap-dialog.min.js'
87 87
             ],
88 88
         ],
Please login to merge, or discard this patch.
module/Orders/config/acl.config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8 8
  */
9 9
 
10
-return [ 'acl' => [
10
+return ['acl' => [
11 11
 
12 12
     'rules' => [
13 13
         'admin' => [
Please login to merge, or discard this patch.
module/Orders/src/Entity/Order.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
      */
237 237
     public function setPrice($amount)
238 238
     {
239
-        $tax    = $this->getTaxRate()  / 100;
239
+        $tax = $this->getTaxRate() / 100;
240 240
         $taxAmount = $amount * $tax;
241 241
 
242 242
         $this->prices = [
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         return $this;
249 249
     }
250 250
 
251
-    public function getPrice($type="net")
251
+    public function getPrice($type = "net")
252 252
     {
253 253
         if (!$this->prices || !array_key_exists($type, $this->prices)) {
254 254
             return 0;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      *
265 265
      * @return array
266 266
      */
267
-    public function getPrices($calculate=false)
267
+    public function getPrices($calculate = false)
268 268
     {
269 269
         /*if (!$this->prices || $calculate) {
270 270
             $this->calculatePrices();
Please login to merge, or discard this patch.
module/Orders/src/Repository/Orders.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@
 block discarded – undo
22 22
  */
23 23
 class Orders extends AbstractRepository
24 24
 {
25
-    public function createJobOrder(array $data=[])
25
+    public function createJobOrder(array $data = [])
26 26
     {
27 27
         $data['type'] = OrderInterface::TYPE_JOB;
28 28
 
29 29
         return $this->create($data);
30 30
     }
31 31
 
32
-    public function create(array $data=[], $counterName = null, $counterFormat = null)
32
+    public function create(array $data = [], $counterName = null, $counterFormat = null)
33 33
     {
34 34
         if (isset($data['counter'])) {
35 35
             $counterName = $data['counter'];
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Controller/ManageController.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
         $jobEntity = $this->initializeJob()->get($this->params());
140 140
 
141 141
         $model = new ViewModel([
142
-                                   'portals' => $jobEntity->getPortals(),
143
-                                   'channels' => $channels,
144
-                                   'defaultCurrencyCode' => $options->defaultCurrencyCode,
145
-                                   'defaultTaxRate' =>  $options->defaultTaxRate,
146
-                                   'jobId' => $jobEntity->getId()
147
-                               ]);
142
+                                    'portals' => $jobEntity->getPortals(),
143
+                                    'channels' => $channels,
144
+                                    'defaultCurrencyCode' => $options->defaultCurrencyCode,
145
+                                    'defaultTaxRate' =>  $options->defaultTaxRate,
146
+                                    'jobId' => $jobEntity->getId()
147
+                                ]);
148 148
         $model->setTemplate('jobs/partials/channel-list')->setTerminal(true);
149 149
         return $model;
150 150
     }
@@ -440,9 +440,9 @@  discard block
 block discarded – undo
440 440
             // we want just some Values to be compared
441 441
             $diff = null;
442 442
             foreach (array('title', 'organization', 'location',
443
-                         'templateValues.qualifications', 'templateValues.requirements', 'templateValues.benefits', 'templateValues.title',
444
-                         'templateValues._freeValues.description',
445
-                     ) as $prelKey) {
443
+                            'templateValues.qualifications', 'templateValues.requirements', 'templateValues.benefits', 'templateValues.title',
444
+                            'templateValues._freeValues.description',
445
+                        ) as $prelKey) {
446 446
                 if (array_key_exists($prelKey, $prelDiff)) {
447 447
                     $diff[$prelKey] = $prelDiff[$prelKey];
448 448
                 }
@@ -471,28 +471,28 @@  discard block
 block discarded – undo
471 471
             'lang/jobs/view',
472 472
             array(),
473 473
             array('query' =>
474
-                      array( 'id' => $jobEntity->getId()))
474
+                        array( 'id' => $jobEntity->getId()))
475 475
         );
476 476
 
477 477
         $approvalLink = $this->url()->fromRoute(
478 478
             'lang/jobs/approval',
479 479
             array('state' => 'approved'),
480 480
             array('query' =>
481
-                      array( 'id' => $jobEntity->getId()))
481
+                        array( 'id' => $jobEntity->getId()))
482 482
         );
483 483
 
484 484
         $declineLink = $this->url()->fromRoute(
485 485
             'lang/jobs/approval',
486 486
             array('state' => 'declined'),
487 487
             array('query' =>
488
-                      array( 'id' => $jobEntity->getId()))
488
+                        array( 'id' => $jobEntity->getId()))
489 489
         );
490 490
 
491 491
         return array('job' => $jobEntity,
492
-                     'diffSnapshot' => $diff,
493
-                     'viewLink' => $viewLink,
494
-                     'approvalLink' => $approvalLink,
495
-                     'declineLink' => $declineLink);
492
+                        'diffSnapshot' => $diff,
493
+                        'viewLink' => $viewLink,
494
+                        'approvalLink' => $approvalLink,
495
+                        'declineLink' => $declineLink);
496 496
     }
497 497
 
498 498
     /**
Please login to merge, or discard this patch.
Doc Comments   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     }
67 67
 
68 68
     /**
69
-     * @return $this|void
69
+     * @return ManageController
70 70
      */
71 71
     public function attachDefaultListeners()
72 72
     {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     /**
110 110
      *
111 111
      *
112
-     * @return null|ViewModel
112
+     * @return ViewModel
113 113
      */
114 114
     public function editAction()
115 115
     {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     }
125 125
 
126 126
     /**
127
-     * @return null|ViewModel
127
+     * @return ViewModel
128 128
      */
129 129
     public function saveAction()
130 130
     {
@@ -159,8 +159,7 @@  discard block
 block discarded – undo
159 159
      *
160 160
      * parameter are arbitrary elements for defaults or programming flow
161 161
      *
162
-     * @param array $parameter
163
-     * @return null|ViewModel
162
+     * @return ViewModel
164 163
      * @throws \RuntimeException
165 164
      */
166 165
     protected function save()
@@ -366,7 +365,7 @@  discard block
 block discarded – undo
366 365
 
367 366
     /**
368 367
      * @param $job
369
-     * @return mixed
368
+     * @return \Jobs\Form\Job
370 369
      */
371 370
     protected function getFormular($job)
372 371
     {
@@ -388,7 +387,7 @@  discard block
 block discarded – undo
388 387
     }
389 388
 
390 389
     /**
391
-     * @param $form
390
+     * @param \Jobs\Form\Job $form
392 391
      * @param array $params
393 392
      * @return ViewModel
394 393
      */
@@ -527,7 +526,7 @@  discard block
 block discarded – undo
527 526
     /**
528 527
      * Deactivate a job posting
529 528
      *
530
-     * @return null|ViewModel
529
+     * @return ViewModel
531 530
      */
532 531
     public function deactivateAction()
533 532
     {
@@ -564,7 +563,7 @@  discard block
 block discarded – undo
564 563
     }
565 564
 
566 565
     /**
567
-     * @param $script
566
+     * @param string $script
568 567
      * @param array $parameter
569 568
      * @return ViewModel
570 569
      */
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         if (empty($user->info->email)) {
173 173
             return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail'));
174 174
         }
175
-        $userOrg            = $user->getOrganization();
175
+        $userOrg = $user->getOrganization();
176 176
         if (!$userOrg->hasAssociation()) {
177 177
             return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany'));
178 178
         }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
         $jobEntity = $this->initializeJob()->get($this->params(), true);
188 188
 
189
-        $viewModel          = null;
189
+        $viewModel = null;
190 190
         $this->acl($jobEntity, 'edit');
191 191
         if ($status = $params->fromQuery('status')) {
192 192
             $this->changeStatus($jobEntity, $status);
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
         $instanceForm       = null;
199 199
         $formErrorMessages = array();
200 200
 
201
-        if (isset($formIdentifier) &&  $request->isPost()) {
201
+        if (isset($formIdentifier) && $request->isPost()) {
202 202
             // at this point the form get instantiated and immediately accumulated
203 203
             $instanceForm = $form->getForm($formIdentifier);
204 204
             if (!isset($instanceForm)) {
205
-                throw new \RuntimeException('No form found for "' . $formIdentifier . '"');
205
+                throw new \RuntimeException('No form found for "'.$formIdentifier.'"');
206 206
             }
207 207
             // the id may be part of the postData, but it never should be altered
208 208
             $postData = $request->getPost();
@@ -256,20 +256,20 @@  discard block
 block discarded – undo
256 256
             $jobValid = false;
257 257
             $errorMessage[] = $this->translator->translate('Accept the Terms');
258 258
         }
259
-        $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]);
259
+        $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]);
260 260
         foreach ($result as $messages) {
261 261
             if (!$messages) {
262 262
                 continue;
263 263
             }
264 264
             if (!is_array($messages)) {
265
-                $messages = [ $messages ];
265
+                $messages = [$messages];
266 266
             }
267 267
 
268 268
             $errorMessage = array_merge($errorMessage, $messages);
269 269
             $jobValid = false;
270 270
         }
271 271
 
272
-        $errorMessage = '<br />' . implode('<br />', $errorMessage);
272
+        $errorMessage = '<br />'.implode('<br />', $errorMessage);
273 273
         if ($isAjax) {
274 274
             if ($instanceForm instanceof SummaryForm) {
275 275
                 $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY);
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             } else {
278 278
                 $viewHelper = 'form';
279 279
             }
280
-            $viewHelperManager  = $serviceLocator->get('ViewHelperManager');
280
+            $viewHelperManager = $serviceLocator->get('ViewHelperManager');
281 281
             $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm);
282 282
             $viewModel = new JsonModel(
283 283
                 array(
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                     }
301 301
                 }
302 302
             } else {
303
-                $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]);
303
+                $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]);
304 304
                 // Job is deployed, some changes are now disabled
305 305
                 $form->enableAll();
306 306
             }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
             $completionLink = $this->url()->fromRoute(
310 310
                 'lang/jobs/completion',
311
-                [ 'id' => $jobEntity->getId()]
311
+                ['id' => $jobEntity->getId()]
312 312
             );
313 313
 
314 314
             $viewModel = $this->getViewModel($form);
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
         // array with differences between the last snapshot and the actual entity
463 463
         // is remains Null if there is no snapshot
464 464
         // it will be an empty array if the snapshot and the actual entity do not differ
465
-        $diff           = null;
465
+        $diff = null;
466 466
         // preliminary difference, contain all differences
467 467
         $prelDiff = $this->entitySnapshot()->diff($jobEntity);
468 468
         if (isset($prelDiff)) {
@@ -500,21 +500,21 @@  discard block
 block discarded – undo
500 500
             'lang/jobs/view',
501 501
             array(),
502 502
             array('query' =>
503
-                      array( 'id' => $jobEntity->getId()))
503
+                      array('id' => $jobEntity->getId()))
504 504
         );
505 505
 
506 506
         $approvalLink = $this->url()->fromRoute(
507 507
             'lang/jobs/approval',
508 508
             array('state' => 'approved'),
509 509
             array('query' =>
510
-                      array( 'id' => $jobEntity->getId()))
510
+                      array('id' => $jobEntity->getId()))
511 511
         );
512 512
 
513 513
         $declineLink = $this->url()->fromRoute(
514 514
             'lang/jobs/approval',
515 515
             array('state' => 'declined'),
516 516
             array('query' =>
517
-                      array( 'id' => $jobEntity->getId()))
517
+                      array('id' => $jobEntity->getId()))
518 518
         );
519 519
 
520 520
         return array('job' => $jobEntity,
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
      */
532 532
     public function deactivateAction()
533 533
     {
534
-        $user           = $this->auth->getUser();
534
+        $user = $this->auth->getUser();
535 535
 
536 536
         $jobEntity = $this->initializeJob()->get($this->params());
537 537
 
Please login to merge, or discard this patch.
module/Core/src/Core/Form/Element/DatePicker.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     }
35 35
 
36 36
     /**
37
-     * @return string|\Zend\View\Helper\HelperInterface
37
+     * @return string
38 38
      */
39 39
     public function getViewHelper()
40 40
     {
Please login to merge, or discard this patch.
Jobs/src/Jobs/Factory/Form/Hydrator/OrganizationNameHydratorFactory.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  *
17 17
  * @ODM\MappedSuperclass
18
-  */
18
+ */
19 19
 abstract class AbstractIdentifiableEntity extends AbstractEntity implements IdentifiableEntityInterface
20 20
 {
21 21
        
Please login to merge, or discard this patch.