Completed
Pull Request — develop (#509)
by ANTHONIUS
21:03
created
module/Applications/src/Mail/Confirmation.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
     }
104 104
 
105 105
     /**
106
-     * @return mixed
106
+     * @return string
107 107
      */
108 108
     protected function getJobTitle()
109 109
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,11 +174,11 @@
 block discarded – undo
174 174
             return '';
175 175
         }
176 176
 
177
-        $token = $user instanceof AnonymousUser ? '?token=' . $user->getToken() : '';
177
+        $token = $user instanceof AnonymousUser ? '?token='.$user->getToken() : '';
178 178
         $href  = $router->assemble(
179 179
                         ['id' => $this->application->getId()],
180 180
                         ['name'=>'lang/applications/detail', 'force_canonical'=>true]
181
-        ) . $token;
181
+        ).$token;
182 182
 
183 183
         return $href;
184 184
     }
Please login to merge, or discard this patch.
module/Applications/src/Options/ModuleOptions.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     /**
122 122
      * Gets the the maximum number of allowed attachments
123 123
      *
124
-     * @return string
124
+     * @return integer
125 125
      */
126 126
     public function getAttachmentsCount()
127 127
     {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     /**
143 143
      * Gets the the maximum size of contact images in bytes
144 144
      *
145
-     * @return string
145
+     * @return integer
146 146
      */
147 147
     public function getContactImageMaxSize()
148 148
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 
80 80
     protected $workflow = [
81 81
 
82
-      'recruiter',
82
+        'recruiter',
83 83
     ];
84 84
 
85 85
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@
 block discarded – undo
237 237
      */
238 238
     public function setAllowSubsequentAttachmentUpload($allowSubsequentAttachmentUpload)
239 239
     {
240
-        $this->allowSubsequentAttachmentUpload = (bool)$allowSubsequentAttachmentUpload;
240
+        $this->allowSubsequentAttachmentUpload = (bool) $allowSubsequentAttachmentUpload;
241 241
         
242 242
         return $this;
243 243
     }
Please login to merge, or discard this patch.
Applications/src/Repository/Event/DeleteRemovedAttachmentsSubscriber.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@
 block discarded – undo
35 35
     /**
36 36
      * Updates fiile permissions on Flush
37 37
      *
38
-     * @param OnFlushEventArgs $eventArgs
39
-     * @return boolean
38
+     * @param LifecycleEventArgs $eventArgs
39
+     * @return boolean|null
40 40
      */
41 41
     public function postRemoveEntity(LifecycleEventArgs $eventArgs)
42 42
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,14 +51,14 @@
 block discarded – undo
51 51
         $fileId = new \MongoId($file->id);
52 52
         
53 53
         $dm->createQueryBuilder('Applications\Entity\Application')
54
-           ->update()->multiple(true)
55
-           ->field('attachments')->equals($fileId)->pull($fileId)
56
-           ->getQuery()->execute();
54
+            ->update()->multiple(true)
55
+            ->field('attachments')->equals($fileId)->pull($fileId)
56
+            ->getQuery()->execute();
57 57
         
58 58
         
59 59
         $dm->createQueryBuilder('Applications\Entity\Application')
60
-           ->update()->multiple(true)
61
-           ->field('contact.image')->equals($fileId)->set(null)
62
-           ->getQuery()->execute();
60
+            ->update()->multiple(true)
61
+            ->field('contact.image')->equals($fileId)->set(null)
62
+            ->getQuery()->execute();
63 63
     }
64 64
 }
Please login to merge, or discard this patch.
Applications/src/Repository/Event/UpdateFilesPermissionsSubscriber.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      * Updates fiile permissions on Flush
36 36
      *
37 37
      * @param OnFlushEventArgs $eventArgs
38
-     * @return boolean
38
+     * @return boolean|null
39 39
      */
40 40
     public function onFlush(OnFlushEventArgs $eventArgs)
41 41
     {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
                
57 57
                 foreach ($document->getAttachments() as $attachment) {  /* @var \Applications\Entity\Attachment $attachment */
58 58
                     $attachment->getPermissions()
59
-                               ->clear()
60
-                               ->inherit($permissions);
59
+                                ->clear()
60
+                                ->inherit($permissions);
61 61
                     if ($isUpdate) {
62 62
                         $uow->computeChangeSet(
63 63
                             $dm->getClassMetadata(get_class($attachment)),
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
                 
69 69
                 if ($image = $document->getContact()->getImage()) {
70 70
                     $image->getPermissions()
71
-                          ->clear()
72
-                          ->inherit($permissions);
71
+                            ->clear()
72
+                            ->inherit($permissions);
73 73
                     if ($isUpdate) {
74 74
                         $uow->computeChangeSet(
75 75
                             $dm->getClassMetadata(get_class($image)),
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $dm  = $eventArgs->getDocumentManager();
43 43
         $uow = $dm->getUnitOfWork();
44 44
         
45
-        $filter = function ($element) {
45
+        $filter = function($element) {
46 46
             return $element instanceof ApplicationInterface
47 47
                    && $element->getPermissions()->hasChanged();
48 48
         };
Please login to merge, or discard this patch.
module/Behat/src/CoreContext.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,7 +106,6 @@  discard block
 block discarded – undo
106 106
     
107 107
     /**
108 108
      * @param $name
109
-     * @param array $params
110 109
      *
111 110
      * @return string
112 111
      */
@@ -117,6 +116,7 @@  discard block
 block discarded – undo
117 116
 
118 117
     /**
119 118
      * @When /^I hover over the element "([^"]*)"$/
119
+     * @param string $locator
120 120
      */
121 121
     public function iHoverOverTheElement($locator)
122 122
     {
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
     }
262 262
     
263 263
     /**
264
-     * @param $locator
264
+     * @param string $locator
265 265
      * @param string $selector
266 266
      *
267
-     * @return \Behat\Mink\Element\NodeElement|mixed|null
267
+     * @return \Behat\Mink\Element\NodeElement|null
268 268
      */
269 269
     public function getElement($locator, $selector='css')
270 270
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     public function iSetMainWindowName()
168 168
     {
169 169
         $window_name = 'main_window';
170
-        $script = 'window.name = "' . $window_name . '"';
170
+        $script = 'window.name = "'.$window_name.'"';
171 171
         $this->getSession()->executeScript($script);
172 172
     }
173 173
     
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
                 break;
227 227
             
228 228
             default:
229
-                throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath');
229
+                throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath');
230 230
                 break;
231 231
         }
232 232
         
233 233
         try {
234 234
             $this->getSession()->executeScript($function);
235 235
         } catch (\Exception $e) {
236
-            throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"');
236
+            throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"');
237 237
         }
238 238
     }
239 239
     
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      *
254 254
      * @return \Behat\Mink\Element\NodeElement|mixed|null
255 255
      */
256
-    public function getElement($locator, $selector='css')
256
+    public function getElement($locator, $selector = 'css')
257 257
     {
258 258
         $page = $this->minkContext->getSession()->getPage();
259 259
         $element = $page->find('css', $locator);
@@ -287,12 +287,12 @@  discard block
 block discarded – undo
287 287
         $session = $this->getSession();
288 288
         $element = $session->getPage()->find(
289 289
             'xpath',
290
-            $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]')
290
+            $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'.$text.'"]')
291 291
         );
292 292
         if (null === $element) {
293 293
             $element = $session->getPage()->find(
294 294
                 'named',
295
-                array('id',$text)
295
+                array('id', $text)
296 296
             );
297 297
         }
298 298
         if (null === $element) {
Please login to merge, or discard this patch.
module/Behat/src/UserContext.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,6 +219,9 @@  discard block
 block discarded – undo
219 219
         $this->startLogin($user, 'test');
220 220
     }
221 221
     
222
+    /**
223
+     * @param string $password
224
+     */
222 225
     private function startLogin(UserInterface $user, $password)
223 226
     {
224 227
         $currentUser = $this->currentUser;
@@ -264,7 +267,7 @@  discard block
 block discarded – undo
264 267
      * @param string $fullname
265 268
      * @param string $role
266 269
      *
267
-     * @return \Auth\Entity\UserInterface
270
+     * @return \Core\Entity\EntityInterface
268 271
      */
269 272
     public function createUser($email, $password, $role=User::ROLE_RECRUITER, $fullname="Test Recruiter")
270 273
     {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected $currentUser;
65 65
     
66
-    public function __construct($parameters=[])
66
+    public function __construct($parameters = [])
67 67
     {
68 68
         $defaultLoginInfo = [
69 69
             'facebook' => [
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
76 76
             ],
77 77
         ];
78
-        $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
78
+        $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : [];
79 79
         $this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig);
80 80
     }
81 81
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @Given I am logged in as a recruiter
143 143
      * @Given I am logged in as a recruiter with :organization as organization
144 144
      */
145
-    public function iAmLoggedInAsARecruiter($organization=null)
145
+    public function iAmLoggedInAsARecruiter($organization = null)
146 146
     {
147 147
         $user = $this->thereIsAUserIdentifiedBy(
148 148
             '[email protected]',
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     public function iDonTHaveUser($login)
175 175
     {
176 176
         $repo = $this->getUserRepository();
177
-        $user=$repo->findByLogin($login);
177
+        $user = $repo->findByLogin($login);
178 178
         if ($user instanceof UserInterface) {
179 179
             $repo->remove($user, true);
180 180
         }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     private function startLogin(UserInterface $user, $password)
223 223
     {
224 224
         $currentUser = $this->currentUser;
225
-        if (!is_object($currentUser) || $user->getId()!=$currentUser->getId()) {
225
+        if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) {
226 226
             $this->iWantToLogIn();
227 227
             $this->iSpecifyTheUsernameAs($user->getLogin());
228 228
             $this->iSpecifyThePasswordAs($password);
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
     /**
243 243
      * @Given there is a user :email identified by :password
244 244
      */
245
-    public function thereIsAUserIdentifiedBy($email, $password, $role=User::ROLE_RECRUITER, $fullname="Test Recruiter", $organization=null)
245
+    public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null)
246 246
     {
247 247
         $repo = $this->getUserRepository();
248
-        if (!is_object($user=$repo->findByEmail($email))) {
248
+        if (!is_object($user = $repo->findByEmail($email))) {
249 249
             $user = $this->createUser($email, $password, $role, $fullname, $organization);
250 250
         }
251 251
         
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      *
267 267
      * @return \Auth\Entity\UserInterface
268 268
      */
269
-    public function createUser($email, $password, $role=User::ROLE_RECRUITER, $fullname="Test Recruiter")
269
+    public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter")
270 270
     {
271 271
         /* @var Register $service */
272 272
         /* @var User $user */
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         $expFullName = explode(' ', $fullname);
281 281
         $info = $user->getInfo();
282 282
         $info->setFirstName(array_shift($expFullName));
283
-        $info->setLastName(count($expFullName)>0 ? implode(' ', $expFullName):'');
283
+        $info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : '');
284 284
         $info->setEmail($email);
285 285
         $info->setEmailVerified(true);
286 286
         $repo->store($user);
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
         /* @var $repoOrganization OrganizationRepository */
311 311
         $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
312 312
         $result = $repoOrganization->findByName($orgName);
313
-        $organization = count($result) > 0 ? $result[0]:null;
313
+        $organization = count($result) > 0 ? $result[0] : null;
314 314
         if (!$organization instanceof Organization) {
315 315
             $organization = new Organization();
316 316
             $organizationName = new OrganizationName($orgName);
@@ -426,12 +426,12 @@  discard block
 block discarded – undo
426 426
     {
427 427
         $repo = $this->getUserRepository();
428 428
         $data = $table->getRowsHash();
429
-        $email = isset($data['email']) ? $data['email']:'[email protected]';
430
-        $password = isset($data['password']) ? $data['password']:'test';
431
-        $fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
432
-        $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
429
+        $email = isset($data['email']) ? $data['email'] : '[email protected]';
430
+        $password = isset($data['password']) ? $data['password'] : 'test';
431
+        $fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User';
432
+        $role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER;
433 433
         
434
-        if (!is_object($user=$repo->findByLogin($email))) {
434
+        if (!is_object($user = $repo->findByLogin($email))) {
435 435
             $user = $this->createUser($email, $password, $role, $fullname);
436 436
         }
437 437
         $this->currentUser = $user;
Please login to merge, or discard this patch.
module/Core/src/Collection/IdentityWrapper.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -374,7 +374,6 @@
 block discarded – undo
374 374
     }
375 375
 
376 376
     /**
377
-     * @param mixed $element
378 377
      * @return mixed
379 378
      */
380 379
     protected function getElement($key)
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function getKeys()
118 118
     {
119
-        return $this->collection->map(function ($element) {
119
+        return $this->collection->map(function($element) {
120 120
             return $this->getKey($element);
121 121
         })->toArray();
122 122
     }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function offsetExists($offset)
304 304
     {
305
-        return (bool)$this->getElement($offset);
305
+        return (bool) $this->getElement($offset);
306 306
     }
307 307
     
308 308
     /**
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
     {
353 353
         if (!isset($this->identityExtractor)) {
354 354
             // default identity extractor
355
-            $this->identityExtractor = function ($element) {
355
+            $this->identityExtractor = function($element) {
356 356
                 if (!is_callable([$element, 'getId'])) {
357 357
                     throw new \LogicException('$element must have getId() method');
358 358
                 }
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      */
380 380
     protected function getElement($key)
381 381
     {
382
-        return $this->collection->filter(function ($element) use ($key) {
382
+        return $this->collection->filter(function($element) use ($key) {
383 383
             return $this->getKey($element) == $key;
384 384
         })->first();
385 385
     }
Please login to merge, or discard this patch.
module/Core/src/Controller/Console/AssetsInstallController.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -201,6 +201,7 @@
 block discarded – undo
201 201
      * Try to create relative symlink.
202 202
      *
203 203
      * Falling back to absolute symlink and finally hard copy.
204
+     * @param string $targetDir
204 205
      */
205 206
     private function relativeSymlinkWithFallback($originDir, $targetDir)
206 207
     {
Please login to merge, or discard this patch.
module/Core/src/Controller/Console/SubsplitController.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -153,6 +153,9 @@
 block discarded – undo
153 153
         $this->runCommand($command);
154 154
     }
155 155
 
156
+    /**
157
+     * @param string $command
158
+     */
156 159
     private function runCommand($command)
157 160
     {
158 161
         if ($this->io->getVerbosity() === OutputInterface::VERBOSITY_DEBUG) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
     private function runCommand($command)
157 157
     {
158 158
         if ($this->io->getVerbosity() === OutputInterface::VERBOSITY_DEBUG) {
159
-            $command.=' --debug';
159
+            $command .= ' --debug';
160 160
             $this->io->writeln("Executing: <info>$command</info>");
161 161
         }
162 162
         if ($this->dryRun) {
Please login to merge, or discard this patch.