Completed
Pull Request — develop (#223)
by ANTHONIUS
08:52
created
module/Auth/src/Auth/Controller/IndexController.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
      * @param $auth  AuthenticationService
55 55
      * @param $logger LoggerInterface
56 56
      * @param $forms
57
-     * @param $options ModuleOptions
57
+     * @param ModuleOptions $options ModuleOptions
58 58
      */
59 59
     public function __construct(AuthenticationService $auth, LoggerInterface $logger,array $forms, $options)
60 60
     {
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 class IndexController extends AbstractActionController
32 32
 {
33 33
 
34
-    const LOGIN='login';
35
-    const REGISTER='register';
34
+    const LOGIN = 'login';
35
+    const REGISTER = 'register';
36 36
 
37 37
     /**
38 38
      * @var AuthenticationService
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $registerForm = $this->forms[self::REGISTER];
89 89
 
90 90
         /* @var $request \Zend\Http\Request */
91
-        $request   = $this->getRequest();
91
+        $request = $this->getRequest();
92 92
 
93 93
         if ($request->isPost()) {
94 94
             $data                          = $this->params()->fromPost();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             if (array_key_exists('credentials', $data) &&
107 107
                 array_key_exists('login', $data['credentials']) &&
108 108
                 array_key_exists('credential', $data['credentials'])) {
109
-                $adapter->setIdentity($data['credentials']['login'] . $loginSuffix)
109
+                $adapter->setIdentity($data['credentials']['login'].$loginSuffix)
110 110
                     ->setCredential($data['credentials']['credential']);
111 111
             }
112 112
             
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
                     $headers = $request->getHeaders();
123 123
                     if ($headers->has('Accept-Language')) {
124 124
                         $locales = $headers->get('Accept-Language')->getPrioritized();
125
-                        $language  = $locales[0]->type;
125
+                        $language = $locales[0]->type;
126 126
                     } else {
127 127
                         $language = 'en';
128 128
                     }
129 129
                 }
130
-                $this->logger->info('User ' . $user->login . ' logged in');
130
+                $this->logger->info('User '.$user->login.' logged in');
131 131
                 
132 132
                 $ref = $this->params()->fromQuery('ref', false);
133 133
 
134 134
                 if ($ref) {
135 135
                     $ref = urldecode($ref);
136
-                    $url = preg_replace('~/[a-z]{2}(/|$)~', '/' . $language . '$1', $ref);
137
-                    $url = $request->getBasePath() . $url;
136
+                    $url = preg_replace('~/[a-z]{2}(/|$)~', '/'.$language.'$1', $ref);
137
+                    $url = $request->getBasePath().$url;
138 138
                 } else {
139 139
                     $urlHelper = $services->get('ViewHelperManager')->get('url');
140 140
                     $url = $urlHelper('lang', array('lang' => $language));
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
             } else {
145 145
                 $loginName = $data['credentials']['login'];
146 146
                 if (!empty($loginSuffix)) {
147
-                    $loginName = $loginName . ' (' . $loginName . $loginSuffix . ')';
147
+                    $loginName = $loginName.' ('.$loginName.$loginSuffix.')';
148 148
                 }
149
-                $this->logger->info('Failed to authenticate User ' . $loginName);
149
+                $this->logger->info('Failed to authenticate User '.$loginName);
150 150
                 $this->notification()->danger(/*@translate*/ 'Authentication failed.');
151 151
             }
152 152
         }
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
             try {
206 206
                 $user          = $auth->getUser();
207 207
                 $password      = substr(md5(uniqid()), 0, 6);
208
-                $login         = uniqid() . ($this->options->auth_suffix != "" ? '@' . $this->options->auth_suffix : '');
209
-                $externalLogin = isset($user->login)?$user->login:'-- not communicated --';
210
-                $this->logger->debug('first login via ' . $provider . ' as: ' . $externalLogin);
208
+                $login         = uniqid().($this->options->auth_suffix != "" ? '@'.$this->options->auth_suffix : '');
209
+                $externalLogin = isset($user->login) ? $user->login : '-- not communicated --';
210
+                $this->logger->debug('first login via '.$provider.' as: '.$externalLogin);
211 211
 
212
-                $user->login=$login;
212
+                $user->login = $login;
213 213
                 $user->setPassword($password);
214 214
                 $user->setRole($this->options->getRole());
215 215
 
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
                 );
227 227
                 $mail->addTo($user->getInfo()->getEmail());
228 228
 
229
-                $loggerId = $login . ' (' . $provider . ': ' . $externalLogin . ')';
229
+                $loggerId = $login.' ('.$provider.': '.$externalLogin.')';
230 230
                 if (isset($mail) && $this->mailer($mail)) {
231
-                    $this->logger->info('Mail first-login for ' . $loggerId . ' sent to ' . $user->getInfo()->getEmail());
231
+                    $this->logger->info('Mail first-login for '.$loggerId.' sent to '.$user->getInfo()->getEmail());
232 232
                 } else {
233
-                    $this->logger->warn('No Mail was sent for ' . $loggerId);
233
+                    $this->logger->warn('No Mail was sent for '.$loggerId);
234 234
                 }
235 235
             } catch (\Exception $e) {
236 236
                 $this->logger->crit($e);
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
         }
242 242
         
243 243
         $user = $auth->getUser();
244
-        $this->logger->info('User ' . $auth->getUser()->getInfo()->getDisplayName() . ' logged in via ' . $provider);
244
+        $this->logger->info('User '.$auth->getUser()->getInfo()->getDisplayName().' logged in via '.$provider);
245 245
         $settings = $user->getSettings('Core');
246 246
         if (null !== $settings->localization->language) {
247 247
             $basePath = $this->getRequest()->getBasePath();
248
-            $ref = preg_replace('~^'.$basePath . '/[a-z]{2}(/)?~', $basePath . '/' . $settings->localization->language . '$1', $ref);
248
+            $ref = preg_replace('~^'.$basePath.'/[a-z]{2}(/)?~', $basePath.'/'.$settings->localization->language.'$1', $ref);
249 249
         }
250 250
         return $this->redirect()->toUrl($ref);
251 251
     }
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
         
278 278
         if ($result->isValid()) {
279 279
             $this->logger->info(
280
-                'User ' . $this->params()->fromPost('user') .
281
-                ' logged via ' . $appKey
280
+                'User '.$this->params()->fromPost('user').
281
+                ' logged via '.$appKey
282 282
             );
283 283
             
284 284
             // the external login may include some parameters for an update
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             if (array_key_exists('firstLogin', $resultMessage) && $resultMessage['firstLogin'] === true) {
310 310
                 // first external Login
311 311
                 $userName = $this->params()->fromPost('user');
312
-                $this->logger->debug('first login for User: ' .  $userName);
312
+                $this->logger->debug('first login for User: '.$userName);
313 313
                 //
314 314
                 if (preg_match("/^(.*)@\w+$/", $userName, $realUserName)) {
315 315
                     $userName = $realUserName[1];
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
                 try {
335 335
                     $this->mailer($mail);
336
-                    $this->logger->info('Mail first-login sent to ' . $userName);
336
+                    $this->logger->info('Mail first-login sent to '.$userName);
337 337
                 } catch (\Zend\Mail\Transport\Exception\ExceptionInterface $e) {
338 338
                     $this->logger->warn('No Mail was sent');
339 339
                     $this->logger->debug($e);
@@ -348,8 +348,8 @@  discard block
 block discarded – undo
348 348
             );
349 349
         } else {
350 350
             $this->logger->info(
351
-                'Failed to authenticate User ' . $this->params()->fromPost('user') .
352
-                ' via ' . $this->params()->fromPost('appKey')
351
+                'Failed to authenticate User '.$this->params()->fromPost('user').
352
+                ' via '.$this->params()->fromPost('appKey')
353 353
             );
354 354
             
355 355
             $this->getResponse()->setStatusCode(403);
@@ -374,8 +374,8 @@  discard block
 block discarded – undo
374 374
                 array(
375 375
                 'format' => 'json',
376 376
                     'group' => array(
377
-                        0 => 'testuser4711', 1 => 'flatscreen', 2 => 'flatscreen1', 3 => 'flatscreen2', 4 => 'flatscreen3',  5 => 'flatscreen4',
378
-                        6 => 'flatscreen5', 7 => 'flatscreen6', 8 => 'flatscreen7',  9 => 'flatscreen8', 10 => 'flatscreen9'
377
+                        0 => 'testuser4711', 1 => 'flatscreen', 2 => 'flatscreen1', 3 => 'flatscreen2', 4 => 'flatscreen3', 5 => 'flatscreen4',
378
+                        6 => 'flatscreen5', 7 => 'flatscreen6', 8 => 'flatscreen7', 9 => 'flatscreen8', 10 => 'flatscreen9'
379 379
                     ),
380 380
                     'name' => '(die) Rauscher – Unternehmensberatung & Consulting',
381 381
                 )
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         }
385 385
         $auth = $this->auth;
386 386
         $userGrpAdmin = $auth->getUser();
387
-        $this->logger->info('User ' . $auth->getUser()->getInfo()->getDisplayName());
387
+        $this->logger->info('User '.$auth->getUser()->getInfo()->getDisplayName());
388 388
         $grp = $this->params()->fromQuery('group');
389 389
         
390 390
         // if the request is made by an external host, add his identification-key to the name
@@ -405,16 +405,16 @@  discard block
 block discarded – undo
405 405
             foreach ($params->group as $grp_member) {
406 406
                 try
407 407
                 {
408
-                    $user = $users->findByLogin($grp_member . $loginSuffix);
408
+                    $user = $users->findByLogin($grp_member.$loginSuffix);
409 409
                     if (!empty($user)) {
410 410
                         $groupUserId[] = $user->id;
411 411
                     } else {
412
-                        $notFoundUsers[] = $grp_member . $loginSuffix;
412
+                        $notFoundUsers[] = $grp_member.$loginSuffix;
413 413
                     }
414 414
                 }
415 415
                 catch (\Auth\Exception\UserDeactivatedException $e)
416 416
                 {
417
-                    $notFoundUsers[] = $grp_member . $loginSuffix;
417
+                    $notFoundUsers[] = $grp_member.$loginSuffix;
418 418
                 }
419 419
             }
420 420
         }
@@ -424,9 +424,9 @@  discard block
 block discarded – undo
424 424
             $group->setUsers($groupUserId);
425 425
         }
426 426
         $this->logger->info(
427
-            'Update Group Name: ' . $name . PHP_EOL . str_repeat(' ', 36) . 'Group Owner: ' . $userGrpAdmin->getLogin() . PHP_EOL .
428
-            str_repeat(' ', 36) . 'Group Members Param: ' . implode(',', $params->group) . PHP_EOL .
429
-            str_repeat(' ', 36) . 'Group Members: ' . count($groupUserId) . PHP_EOL . str_repeat(' ', 36) . 'Group Members not found: ' . implode(',', $notFoundUsers)
427
+            'Update Group Name: '.$name.PHP_EOL.str_repeat(' ', 36).'Group Owner: '.$userGrpAdmin->getLogin().PHP_EOL.
428
+            str_repeat(' ', 36).'Group Members Param: '.implode(',', $params->group).PHP_EOL.
429
+            str_repeat(' ', 36).'Group Members: '.count($groupUserId).PHP_EOL.str_repeat(' ', 36).'Group Members not found: '.implode(',', $notFoundUsers)
430 430
         );
431 431
         
432 432
         return new JsonModel(
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     public function logoutAction()
444 444
     {
445 445
         $auth = $this->auth;
446
-        $this->logger->info('User ' . ($auth->getUser()->login==''?$auth->getUser()->info->displayName:$auth->getUser()->login) . ' logged out');
446
+        $this->logger->info('User '.($auth->getUser()->login == '' ? $auth->getUser()->info->displayName : $auth->getUser()->login).' logged out');
447 447
         $auth->clearIdentity();
448 448
         unset($_SESSION['HA::STORE']);
449 449
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -411,8 +411,7 @@
 block discarded – undo
411 411
                     } else {
412 412
                         $notFoundUsers[] = $grp_member . $loginSuffix;
413 413
                     }
414
-                }
415
-                catch (\Auth\Exception\UserDeactivatedException $e)
414
+                } catch (\Auth\Exception\UserDeactivatedException $e)
416 415
                 {
417 416
                     $notFoundUsers[] = $grp_member . $loginSuffix;
418 417
                 }
Please login to merge, or discard this patch.
module/Auth/src/Auth/Options/CaptchaOptions.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
     }
71 71
 
72 72
     /**
73
-     * @return bool
73
+     * @return string
74 74
      */
75 75
     public function getMode()
76 76
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@
 block discarded – undo
40 40
      * @var array
41 41
      */
42 42
     protected $reCaptcha = [
43
-        'public_key' => 'Your Recapture Public Key',      // "site_key"
44
-        'private_key' => 'Your Recapture Private Key',    // "secret_key"
45
-        'ssl' => true,                                    // include google api via http(s)
43
+        'public_key' => 'Your Recapture Public Key', // "site_key"
44
+        'private_key' => 'Your Recapture Private Key', // "secret_key"
45
+        'ssl' => true, // include google api via http(s)
46 46
         ];
47 47
 
48 48
     /**
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Controller/ApiJobListByOrganizationController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
             $response->setStatusCode(Response::STATUS_CODE_404);
42 42
             return $response;
43 43
         }
44
-        $jsonModel=new JsonModel();
44
+        $jsonModel = new JsonModel();
45 45
         $jsonModel->setVariables($this->apiJobDehydrator->dehydrateList($jobs));
46 46
         $jsonModel->setJsonpCallback('yawikParseJobs');
47 47
 
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Form/TemplateLabelBenefits.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,6 +62,6 @@
 block discarded – undo
62 62
                     )
63 63
                 )
64 64
             )
65
-       );
65
+        );
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Form/ListFilterLocationFieldset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                 ),
56 56
                 'attributes' => [
57 57
                     'value' => '10', // default distance
58
-                    'data-searchbox'  => -1,  // hide the search box
58
+                    'data-searchbox'  => -1, // hide the search box
59 59
                     'data-allowclear' => 'false', // allow to clear a selected value
60 60
                     'data-placeholder'  => /*@translate*/ 'Distance',
61 61
                 ]
Please login to merge, or discard this patch.
module/Auth/src/Auth/Form/UserInfoFieldset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
                 'attributes' => [
122 122
                     'data-placeholder' => /*@translate*/ 'please select',
123 123
                     'data-allowclear' => 'false',
124
-                    'data-searchbox' => -1,  // hide the search box
124
+                    'data-searchbox' => -1, // hide the search box
125 125
                     'required' => true, // mark label as required
126 126
                 ],
127 127
             )
Please login to merge, or discard this patch.
module/Jobs/src/Jobs/Form/ListFilterAdminFieldset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                 ),
56 56
                 'attributes' => [
57 57
                     'value' => '10', // default distance
58
-                    'data-searchbox'  => -1,  // hide the search box
58
+                    'data-searchbox'  => -1, // hide the search box
59 59
                     'data-allowclear' => 'false', // allow to clear a selected value
60 60
                     'data-placeholder'  => /*@translate*/ 'Distance',
61 61
                 ]
Please login to merge, or discard this patch.
module/Install/Module.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,6 +60,6 @@
 block discarded – undo
60 60
         $services     = $application->getServiceManager();
61 61
 
62 62
         $services->get('Install/Listener/LanguageSetter')
63
-                 ->attach($eventManager);
63
+                    ->attach($eventManager);
64 64
     }
65 65
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,23 +24,23 @@
 block discarded – undo
24 24
 
25 25
     public function getConfig()
26 26
     {
27
-        return include __DIR__ . '/config/module.config.php';
27
+        return include __DIR__.'/config/module.config.php';
28 28
     }
29 29
 
30 30
     public function getAutoloaderConfig()
31 31
     {
32 32
         return array(
33 33
             'Zend\Loader\ClassMapAutoloader' => array(
34
-                __DIR__ . '/autoload_classmap.php',
34
+                __DIR__.'/autoload_classmap.php',
35 35
                 array(
36 36
                     // We need this filter for initial user creation.
37
-                    'Auth\Entity\Filter\CredentialFilter' => __DIR__ . '/../Auth/src/Auth/Entity/Filter/CredentialFilter.php',
37
+                    'Auth\Entity\Filter\CredentialFilter' => __DIR__.'/../Auth/src/Auth/Entity/Filter/CredentialFilter.php',
38 38
                 ),
39 39
             ),
40 40
             'Zend\Loader\StandardAutoloader' => array(
41 41
                 'namespaces' => array(
42
-                    __NAMESPACE__ => __DIR__ . '/src' /* . __NAMESPACE__*/,
43
-                    __NAMESPACE__ . 'Test' => __DIR__ . '/test/' . __NAMESPACE__ . 'Test',
42
+                    __NAMESPACE__ => __DIR__.'/src' /* . __NAMESPACE__*/,
43
+                    __NAMESPACE__.'Test' => __DIR__.'/test/'.__NAMESPACE__.'Test',
44 44
                 ),
45 45
             ),
46 46
         );
Please login to merge, or discard this patch.
module/Auth/src/Acl/Controller/Plugin/Acl.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,8 +155,8 @@
 block discarded – undo
155 155
     }
156 156
 
157 157
     /**
158
-     * @param null $resource
159
-     * @param null $privilege
158
+     * @param null|string $resource
159
+     * @param null|string $privilege
160 160
      * @param string $mode
161 161
      * @return $this|bool
162 162
      */
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -138,14 +138,14 @@
 block discarded – undo
138 138
         if (!$this->test($resource, $privilege)) {
139 139
             $msg = null === $privilege
140 140
                  ? sprintf(
141
-                     'You are not allowed to access resource "%s"',
142
-                     is_object($resource) ? $resource->getResourceId() : $resource
143
-                 )
141
+                        'You are not allowed to access resource "%s"',
142
+                        is_object($resource) ? $resource->getResourceId() : $resource
143
+                    )
144 144
                  : sprintf(
145
-                     'You are not allowed to execute operation "%s" on resource "%s"',
146
-                     $privilege,
147
-                     is_object($resource) ? $resource->getResourceId() : $resource
148
-                 );
145
+                        'You are not allowed to execute operation "%s" on resource "%s"',
146
+                        $privilege,
147
+                        is_object($resource) ? $resource->getResourceId() : $resource
148
+                    );
149 149
             
150 150
             if ($resource instanceof FileInterface && 0 == strpos($resource->type, 'image/')) {
151 151
                 throw new UnauthorizedImageAccessException(str_replace('resource', 'image', $msg));
Please login to merge, or discard this patch.