Completed
Pull Request — develop (#434)
by Carsten
06:27
created
module/Auth/src/Auth/Controller/ManageController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@
 block discarded – undo
96 96
                     'content' => $content,
97 97
                     )
98 98
                 );
99
-            }
100
-            elseif ($postProfiles) {
99
+            } elseif ($postProfiles) {
101 100
                 $formSocialProfiles->setData($this->params()->fromPost());
102 101
                 
103 102
                 if ($formSocialProfiles->isValid()) {
Please login to merge, or discard this patch.
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -28,66 +28,66 @@  discard block
 block discarded – undo
28 28
  */
29 29
 class ManageController extends AbstractActionController
30 30
 {
31
-	private $userProfileContainer;
31
+    private $userProfileContainer;
32 32
 	
33
-	private $authService;
33
+    private $authService;
34 34
 	
35
-	private $socialProfileForm;
35
+    private $socialProfileForm;
36 36
 	
37
-	private $translator;
37
+    private $translator;
38 38
 	
39
-	private $repositories;
39
+    private $repositories;
40 40
 	
41
-	private $viewHelper;
41
+    private $viewHelper;
42 42
 	
43
-	private $hybridAuthAdapter;
43
+    private $hybridAuthAdapter;
44 44
 	
45
-	/**
46
-	 * @param ContainerInterface $container
47
-	 * @return ManageController
48
-	 */
49
-	static public function factory(ContainerInterface $container)
50
-	{
51
-		$forms = $container->get('forms');
52
-		$userProfileContainer = $forms->get('Auth/UserProfileContainer');
53
-		$socialProfileForm = $forms->get('Auth/SocialProfiles');
54
-		$authService = $container->get('AuthenticationService');
55
-		$translator = $container->get('translator');
56
-		$repositories = $container->get('repositories');
57
-		$viewHelper = $container->get('ViewHelperManager');
58
-		$hybridAuthAdapter = $container->get('HybridAuthAdapter');
59
-		$controller = new ManageController(
60
-			$userProfileContainer,
61
-			$authService,
62
-			$repositories,
63
-			$socialProfileForm,
64
-			$translator,
65
-			$viewHelper,
66
-			$hybridAuthAdapter
67
-		);
68
-		return $controller;
69
-	}
45
+    /**
46
+     * @param ContainerInterface $container
47
+     * @return ManageController
48
+     */
49
+    static public function factory(ContainerInterface $container)
50
+    {
51
+        $forms = $container->get('forms');
52
+        $userProfileContainer = $forms->get('Auth/UserProfileContainer');
53
+        $socialProfileForm = $forms->get('Auth/SocialProfiles');
54
+        $authService = $container->get('AuthenticationService');
55
+        $translator = $container->get('translator');
56
+        $repositories = $container->get('repositories');
57
+        $viewHelper = $container->get('ViewHelperManager');
58
+        $hybridAuthAdapter = $container->get('HybridAuthAdapter');
59
+        $controller = new ManageController(
60
+            $userProfileContainer,
61
+            $authService,
62
+            $repositories,
63
+            $socialProfileForm,
64
+            $translator,
65
+            $viewHelper,
66
+            $hybridAuthAdapter
67
+        );
68
+        return $controller;
69
+    }
70 70
 	
71
-	public function __construct(
72
-		UserProfileContainer $userProfileContainer,
73
-		AuthenticationService $authService,
74
-		RepositoryService $repositories,
75
-		SocialProfiles $socialProfileForm,
76
-		Translator $translator,
77
-		HelperPluginManager $viewHelper,
78
-		HybridAuth $hybridAuthAdapter
79
-	)
80
-	{
81
-		$this->userProfileContainer = $userProfileContainer;
82
-		$this->authService = $authService;
83
-		$this->socialProfileForm = $socialProfileForm;
84
-		$this->repositories = $repositories;
85
-		$this->translator = $translator;
86
-		$this->viewHelper = $viewHelper;
87
-		$this->hybridAuthAdapter = $hybridAuthAdapter;
88
-	}
71
+    public function __construct(
72
+        UserProfileContainer $userProfileContainer,
73
+        AuthenticationService $authService,
74
+        RepositoryService $repositories,
75
+        SocialProfiles $socialProfileForm,
76
+        Translator $translator,
77
+        HelperPluginManager $viewHelper,
78
+        HybridAuth $hybridAuthAdapter
79
+    )
80
+    {
81
+        $this->userProfileContainer = $userProfileContainer;
82
+        $this->authService = $authService;
83
+        $this->socialProfileForm = $socialProfileForm;
84
+        $this->repositories = $repositories;
85
+        $this->translator = $translator;
86
+        $this->viewHelper = $viewHelper;
87
+        $this->hybridAuthAdapter = $hybridAuthAdapter;
88
+    }
89 89
 	
90
-	/**
90
+    /**
91 91
      * @return array|JsonModel
92 92
      */
93 93
     public function profileAction()
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 $postData  = $form->getOption('use_post_array') ? $_POST : array();
122 122
                 //@TODO: [ZF3] option use_files_array is false by default
123 123
                 //$filesData = $form->getOption('use_files_array') ? $_FILES : array();
124
-	            $filesData = $_FILES;
124
+                $filesData = $_FILES;
125 125
                 $data      = array_merge($postData, $filesData);
126 126
                 $form->setData($data);
127 127
                 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
         /* @var \Auth\Form\UserProfileContainer $userProfileContainer */
96 96
         $userProfileContainer = $this->userProfileContainer;
97 97
         $user = $this->authService->getUser(); /* @var $user \Auth\Entity\User */
98
-        $postProfiles = (array)$this->params()->fromPost('social_profiles');
98
+        $postProfiles = (array) $this->params()->fromPost('social_profiles');
99 99
         $userProfiles = $user->getProfile();
100 100
         $formSocialProfiles = $this->socialProfileForm
101 101
             ->setUseDefaultValidation(true)
102
-            ->setData(['social_profiles' => array_map(function ($array)
102
+            ->setData(['social_profiles' => array_map(function($array)
103 103
             {
104 104
                 return $array['data'];
105 105
             }, $userProfiles)]);
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
             $form      = $userProfileContainer->getForm($formName);
119 119
             
120 120
             if ($form) {
121
-                $postData  = $form->getOption('use_post_array') ? $_POST : array();
121
+                $postData = $form->getOption('use_post_array') ? $_POST : array();
122 122
                 //@TODO: [ZF3] option use_files_array is false by default
123 123
                 //$filesData = $form->getOption('use_files_array') ? $_FILES : array();
124 124
 	            $filesData = $_FILES;
125
-                $data      = array_merge($postData, $filesData);
125
+                $data = array_merge($postData, $filesData);
126 126
                 $form->setData($data);
127 127
                 
128 128
                 if (!$form->isValid()) {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                                 ));
184 184
                             } else {
185 185
                                 $profile = [
186
-                                    'auth' => (array)$authProfile,
186
+                                    'auth' => (array) $authProfile,
187 187
                                     'data' => \Zend\Json\Json::decode($dataProfiles[$network])
188 188
                                 ];
189 189
                                 $user->addProfile($network, $profile);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 }
194 194
                 
195 195
                 // keep data in sync & properly decoded
196
-                $formSocialProfiles->setData(['social_profiles' => array_map(function ($array)
196
+                $formSocialProfiles->setData(['social_profiles' => array_map(function($array)
197 197
                 {
198 198
                     return \Zend\Json\Json::decode($array) ?: '';
199 199
                 }, $dataProfiles)]);
Please login to merge, or discard this patch.
module/Core/src/Core/Form/Container.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
     /**
99 99
      * Gets an iterator to iterate over the enabled formulars.
100 100
      *
101
-     * @return \ArrayIterator
101
+     * @return PriorityList
102 102
      * @see IteratorAggregate::getIterator()
103 103
      */
104 104
     public function getIterator()
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -328,11 +328,11 @@
 block discarded – undo
328 328
         }
329 329
 
330 330
         // @TODO: [ZF3] which one is correct? $form[options][label] or $form[options]
331
-	    if(isset($form['label'])){
332
-		    $formLabel = $form['label'];
333
-	    }elseif(isset($form['options']['label'])){
334
-		    $formLabel = $form['options']['label'];
335
-	    }
331
+        if(isset($form['label'])){
332
+            $formLabel = $form['label'];
333
+        }elseif(isset($form['options']['label'])){
334
+            $formLabel = $form['options']['label'];
335
+        }
336 336
 	    
337 337
         if (isset($formLabel)) {
338 338
             $formInstance->setLabel($formLabel);
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 	    
313 313
         //@TODO: [ZF3] Passing options in $formElementManager->get is not working need to do manually set options
314 314
         $formInstance = $this->formElementManager->get($form['type'], $options);
315
-        $formInstance->setOptions(array_merge($formInstance->getOptions(),$options));
315
+        $formInstance->setOptions(array_merge($formInstance->getOptions(), $options));
316 316
         $formInstance->setParent($this);
317 317
         
318 318
         if (isset($form['attributes'])) {
@@ -324,13 +324,13 @@  discard block
 block discarded – undo
324 324
         $formAction = $formInstance->getAttribute('action');
325 325
 
326 326
         if (empty($formAction)) {
327
-            $formInstance->setAttribute('action', '?form=' . $formName);
327
+            $formInstance->setAttribute('action', '?form='.$formName);
328 328
         }
329 329
 
330 330
         // @TODO: [ZF3] which one is correct? $form[options][label] or $form[options]
331
-	    if(isset($form['label'])){
331
+	    if (isset($form['label'])) {
332 332
 		    $formLabel = $form['label'];
333
-	    }elseif(isset($form['options']['label'])){
333
+	    }elseif (isset($form['options']['label'])) {
334 334
 		    $formLabel = $form['options']['label'];
335 335
 	    }
336 336
 	    
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                 $spec->setParent($this);
397 397
             }
398 398
 
399
-            $spec = [ '__instance__' => $spec, 'name' => $key, 'entity' => '*' ];
399
+            $spec = ['__instance__' => $spec, 'name' => $key, 'entity' => '*'];
400 400
         }
401 401
 
402 402
         if (!is_array($spec)) {
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
         }
516 516
         $this->activeForms = array_filter(
517 517
             $this->activeForms,
518
-            function ($item) use ($key) {
518
+            function($item) use ($key) {
519 519
                 return !in_array($item, $key);
520 520
             }
521 521
         );
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
      * @throws \InvalidArgumentException
530 530
      * @return Container
531 531
      */
532
-    public function setEntity($entity, $key='*')
532
+    public function setEntity($entity, $key = '*')
533 533
     {
534 534
         if (!$entity instanceof EntityInterface)
535 535
         {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
      *
553 553
      * @return \Core\Entity\EntityInterface
554 554
      */
555
-    public function getEntity($key='*')
555
+    public function getEntity($key = '*')
556 556
     {
557 557
         return isset($this->entities[$key]) ? $this->entities[$key] : null;
558 558
     }
@@ -754,10 +754,10 @@  discard block
 block discarded – undo
754 754
         $actualKey = $this->getActiveFormActual();
755 755
         if (isset($actualKey)) {
756 756
             $forms = array_keys($this->forms);
757
-            $formsFlip =  array_flip($forms);
757
+            $formsFlip = array_flip($forms);
758 758
             $index = $formsFlip[$actualKey];
759 759
             if (0 < $index) {
760
-                $key = $forms[$index-1];
760
+                $key = $forms[$index - 1];
761 761
             }
762 762
         }
763 763
         return $key;
@@ -774,10 +774,10 @@  discard block
 block discarded – undo
774 774
         $actualKey = $this->getActiveFormActual();
775 775
         if (isset($actualKey)) {
776 776
             $forms = array_keys($this->forms);
777
-            $formsFlip =  array_flip($forms);
777
+            $formsFlip = array_flip($forms);
778 778
             $index = $formsFlip[$actualKey];
779 779
             if ($index < count($forms) - 1) {
780
-                $key = $forms[$index+1];
780
+                $key = $forms[$index + 1];
781 781
             }
782 782
         }
783 783
         return $key;
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
      */
792 792
     public function formatAction($name)
793 793
     {
794
-        return sprintf('%s%s', $this->hasParent() ? $this->getName() . '.' : '', $name);
794
+        return sprintf('%s%s', $this->hasParent() ? $this->getName().'.' : '', $name);
795 795
     }
796 796
 
797 797
     /**
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
     public function getActionFor($key)
802 802
     {
803 803
         if (isset($this->forms[$key])) {
804
-            return '?form=' . $this->formatAction($this->forms[$key]['name']);
804
+            return '?form='.$this->formatAction($this->forms[$key]['name']);
805 805
         }
806 806
     }
807 807
 }
808 808
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -330,7 +330,7 @@
 block discarded – undo
330 330
         // @TODO: [ZF3] which one is correct? $form[options][label] or $form[options]
331 331
 	    if(isset($form['label'])){
332 332
 		    $formLabel = $form['label'];
333
-	    }elseif(isset($form['options']['label'])){
333
+	    } elseif(isset($form['options']['label'])){
334 334
 		    $formLabel = $form['options']['label'];
335 335
 	    }
336 336
 	    
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Entity/WorkflowSettingsInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      * @param bool $acceptApplicationByDepartmentManager
18 18
      * @return WorkflowSettings
19 19
      */
20
-    public function setAcceptApplicationByDepartmentManager( $acceptApplicationByDepartmentManager );
20
+    public function setAcceptApplicationByDepartmentManager($acceptApplicationByDepartmentManager);
21 21
 
22 22
     /**
23 23
      * Gets AcceptApplicationByDepartmentManager
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @param bool $assignDepartmentManagersToJobs
33 33
      * @return WorkflowSettings
34 34
      */
35
-    public function setAssignDepartmentManagersToJobs( $assignDepartmentManagersToJobs );
35
+    public function setAssignDepartmentManagersToJobs($assignDepartmentManagersToJobs);
36 36
 
37 37
     /**
38 38
      * Gets AssignDepartmentManagersToJobs
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Entity/WorkflowSettings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
      * @param bool $acceptApplicationByDepartmentManager
41 41
      * @return WorkflowSettings
42 42
      */
43
-    public function setAcceptApplicationByDepartmentManager( $acceptApplicationByDepartmentManager )
43
+    public function setAcceptApplicationByDepartmentManager($acceptApplicationByDepartmentManager)
44 44
     {
45
-        $this->acceptApplicationByDepartmentManager= $acceptApplicationByDepartmentManager;
45
+        $this->acceptApplicationByDepartmentManager = $acceptApplicationByDepartmentManager;
46 46
         return $this;
47 47
     }
48 48
     
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @param bool $assignDepartmentManagersToJobs
63 63
      * @return WorkflowSettings
64 64
      */
65
-    public function setAssignDepartmentManagersToJobs( $assignDepartmentManagersToJobs )
65
+    public function setAssignDepartmentManagersToJobs($assignDepartmentManagersToJobs)
66 66
     {
67 67
         $this->assignDepartmentManagersToJobs = $assignDepartmentManagersToJobs;
68 68
         return $this;
Please login to merge, or discard this patch.
module/Applications/src/Applications/Entity/Settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
     /**
143 143
      * @return bool
144 144
      */
145
-    public function getAutoConfirmMail(){
145
+    public function getAutoConfirmMail() {
146 146
         return $this->autoConfirmMail;
147 147
     }
148 148
 }
Please login to merge, or discard this patch.
module/Applications/src/Applications/Listener/Events/ApplicationEvent.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
     /**
31 31
      * Event is fired when a new application is saved.
32 32
      */
33
-    const EVENT_APPLICATION_POST_CREATE   = 'application.post.create';
33
+    const EVENT_APPLICATION_POST_CREATE = 'application.post.create';
34 34
 
35 35
     /**
36 36
      * Event is fired when a users deleted application
37 37
      */
38
-    const EVENT_APPLICATION_PRE_DELETE   = 'application.pre.delete';
38
+    const EVENT_APPLICATION_PRE_DELETE = 'application.pre.delete';
39 39
 
40 40
     /**
41 41
      * Event is fired when the status of an application is changed
42 42
      */
43
-    const EVENT_APPLICATION_STATUS_CHANGE   = 'application.status.change';
43
+    const EVENT_APPLICATION_STATUS_CHANGE = 'application.status.change';
44 44
 
45 45
     /**
46 46
      * @var Application $application
@@ -233,12 +233,12 @@  discard block
 block discarded – undo
233 233
             $this->setApplicationEntity($params->application);
234 234
         }
235 235
 
236
-        if(is_array($params) && isset($params['user'])) {
236
+        if (is_array($params) && isset($params['user'])) {
237 237
             $this->setUser($params['user']);
238 238
             unset($params['user']);
239 239
         }
240 240
 
241
-        if(is_array($params) && isset($params['status'])) {
241
+        if (is_array($params) && isset($params['status'])) {
242 242
             $this->setStatus($params['status']);
243 243
             unset($params['status']);
244 244
         }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     }
169 169
 
170 170
     /**
171
-     * @return mixed
171
+     * @return string
172 172
      */
173 173
     public function getStatus()
174 174
     {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     }
177 177
 
178 178
     /**
179
-     * @return mixed
179
+     * @return boolean
180 180
      */
181 181
     public function isPostRequest()
182 182
     {
Please login to merge, or discard this patch.
module/Applications/src/Applications/Controller/IndexController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             $params->set('by', 'me');
41 41
         }
42 42
 
43
-         //default sorting
43
+            //default sorting
44 44
         if (!isset($params['sort'])) {
45 45
             $params['sort']="-date";
46 46
         }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@
 block discarded – undo
42 42
 
43 43
          //default sorting
44 44
         if (!isset($params['sort'])) {
45
-            $params['sort']="-date";
45
+            $params['sort'] = "-date";
46 46
         }
47 47
         $params->count = 5;
48
-        $params->pageRange=5;
48
+        $params->pageRange = 5;
49 49
 
50 50
         $this->paginationParams()->setParams('Applications\Index', $params);
51 51
 
Please login to merge, or discard this patch.
module/Core/src/Core/Form/LocalizationSettingsFieldset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
             )
47 47
         );
48 48
 
49
-        $timezones=array_merge(
49
+        $timezones = array_merge(
50 50
             \DateTimeZone::listIdentifiers(\DateTimeZone::AFRICA),
51 51
             \DateTimeZone::listIdentifiers(\DateTimeZone::AMERICA),
52 52
             \DateTimeZone::listIdentifiers(\DateTimeZone::ASIA),
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/View/Helper/ApplyButtons.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             'sendImmediately' => false
72 72
         ], $options);
73 73
         $view = $this->view;
74
-		$currentTemplate = $view->viewModel()
74
+        $currentTemplate = $view->viewModel()
75 75
             ->getCurrent()
76 76
             ->getTemplate();
77 77
         $partial = dirname($currentTemplate) . '/' . $options['partial'];
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
             $label = $options['oneClickLabel'] ?: $view->translate('Apply with %s');
88 88
             
89 89
             foreach ($data['oneClickProfiles'] as $network) {
90
-				$variables['oneClick'][] = [
90
+                $variables['oneClick'][] = [
91 91
                     'label' => sprintf($label, $network),
92 92
                     'url' => $view->url('lang/apply-one-click', ['applyId' => $data['applyId'], 'network' => $network, 'immediately' => $options['sendImmediately'] ?: null], ['force_canonical' => true]),
93
-				    'network' => $network
93
+                    'network' => $network
94 94
                 ];
95 95
             }
96 96
         }
@@ -98,22 +98,22 @@  discard block
 block discarded – undo
98 98
         return $view->partial($partial, $variables);
99 99
     }
100 100
     
101
-	/**
102
-	 * @return string
103
-	 */
104
-	public function getPartial()
105
-	{
106
-		return $this->partial;
107
-	}
101
+    /**
102
+     * @return string
103
+     */
104
+    public function getPartial()
105
+    {
106
+        return $this->partial;
107
+    }
108 108
 
109
-	/**
110
-	 * @param string $partial
111
-	 * @return ApplyButtons
112
-	 */
113
-	public function setPartial($partial)
114
-	{
115
-		$this->partial = $partial;
109
+    /**
110
+     * @param string $partial
111
+     * @return ApplyButtons
112
+     */
113
+    public function setPartial($partial)
114
+    {
115
+        $this->partial = $partial;
116 116
 		
117
-		return $this;
118
-	}
117
+        return $this;
118
+    }
119 119
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
 		$currentTemplate = $view->viewModel()
75 75
             ->getCurrent()
76 76
             ->getTemplate();
77
-        $partial = dirname($currentTemplate) . '/' . $options['partial'];
77
+        $partial = dirname($currentTemplate).'/'.$options['partial'];
78 78
         
79 79
         if (!$options['oneClickOnly'] && $data['uri']) {
80 80
             $variables['default'] = [
Please login to merge, or discard this patch.