Completed
Pull Request — develop (#501)
by ANTHONIUS
10:57
created
module/Applications/src/Entity/ApplicationInterface.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     /**
241 241
      * Gets all comments for the application.
242 242
      *
243
-     * @return ArrayCollection;
243
+     * @return Collection
244 244
 
245 245
      */
246 246
     public function getComments();
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
     /**
272 272
      * Gets all attributes for an application.
273 273
      *
274
-     * @return ArrayCollection;
274
+     * @return Attributes
275 275
 
276 276
      */
277 277
     public function getAttributes();
Please login to merge, or discard this patch.
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -241,7 +241,6 @@  discard block
 block discarded – undo
241 241
      * Gets all comments for the application.
242 242
      *
243 243
      * @return ArrayCollection;
244
-
245 244
      */
246 245
     public function getComments();
247 246
     
@@ -272,7 +271,6 @@  discard block
 block discarded – undo
272 271
      * Gets all attributes for an application.
273 272
      *
274 273
      * @return ArrayCollection;
275
-
276 274
      */
277 275
     public function getAttributes();
278 276
 
Please login to merge, or discard this patch.
module/Applications/src/Entity/History.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,6 +41,9 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected $message;
43 43
     
44
+    /**
45
+     * @param StatusInterface|null $status
46
+     */
44 47
     public function __construct($status, $message = '[System]')
45 48
     {
46 49
         if (!$status instanceof StatusInterface) {
@@ -116,7 +119,7 @@  discard block
 block discarded – undo
116 119
     /**
117 120
      * Sets the history message
118 121
      *
119
-     * @param $message
122
+     * @param string $message
120 123
      *
121 124
      * @return $this
122 125
      */
Please login to merge, or discard this patch.
module/Applications/src/Listener/Events/ApplicationEvent.php 2 patches
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.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,17 +28,17 @@
 block discarded – undo
28 28
     /**
29 29
      * Event is fired when a new application is saved.
30 30
      */
31
-    const EVENT_APPLICATION_POST_CREATE   = 'application.post.create';
31
+    const EVENT_APPLICATION_POST_CREATE = 'application.post.create';
32 32
 
33 33
     /**
34 34
      * Event is fired when a users deleted application
35 35
      */
36
-    const EVENT_APPLICATION_PRE_DELETE   = 'application.pre.delete';
36
+    const EVENT_APPLICATION_PRE_DELETE = 'application.pre.delete';
37 37
 
38 38
     /**
39 39
      * Event is fired when the status of an application is changed
40 40
      */
41
-    const EVENT_APPLICATION_STATUS_CHANGE   = 'application.status.change';
41
+    const EVENT_APPLICATION_STATUS_CHANGE = 'application.status.change';
42 42
 
43 43
     /**
44 44
      * @var Application $application
Please login to merge, or discard this patch.
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     private $config;
31 31
 
32
-    public function __construct($config=null)
32
+    public function __construct($config = null)
33 33
     {
34 34
         if (is_null($config)) {
35 35
             $config = __DIR__.'/../../../config/config.php';
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
     public function iSetMainWindowName()
181 181
     {
182 182
         $window_name = 'main_window';
183
-        $script = 'window.name = "' . $window_name . '"';
183
+        $script = 'window.name = "'.$window_name.'"';
184 184
         $this->getSession()->executeScript($script);
185 185
     }
186 186
     
@@ -239,14 +239,14 @@  discard block
 block discarded – undo
239 239
                 break;
240 240
             
241 241
             default:
242
-                throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath');
242
+                throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath');
243 243
                 break;
244 244
         }
245 245
         
246 246
         try {
247 247
             $this->getSession()->executeScript($function);
248 248
         } catch (\Exception $e) {
249
-            throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"');
249
+            throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"');
250 250
         }
251 251
     }
252 252
     
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      *
267 267
      * @return \Behat\Mink\Element\NodeElement|mixed|null
268 268
      */
269
-    public function getElement($locator, $selector='css')
269
+    public function getElement($locator, $selector = 'css')
270 270
     {
271 271
         $page = $this->minkContext->getSession()->getPage();
272 272
         $element = $page->find('css', $locator);
@@ -300,12 +300,12 @@  discard block
 block discarded – undo
300 300
         $session = $this->getSession();
301 301
         $element = $session->getPage()->find(
302 302
             'xpath',
303
-            $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]')
303
+            $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'.$text.'"]')
304 304
         );
305 305
         if (null === $element) {
306 306
             $element = $session->getPage()->find(
307 307
                 'named',
308
-                array('id',$text)
308
+                array('id', $text)
309 309
             );
310 310
         }
311 311
         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.