Completed
Pull Request — develop (#453)
by ANTHONIUS
06:37
created
module/Behat/src/UserContext.php 4 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,6 +198,9 @@  discard block
 block discarded – undo
198 198
 		$this->startLogin($user,'test');
199 199
 	}
200 200
 	
201
+	/**
202
+	 * @param string $password
203
+	 */
201 204
 	private function startLogin(UserInterface $user, $password)
202 205
 	{
203 206
 		$currentUser = $this->currentUser;
@@ -242,7 +245,7 @@  discard block
 block discarded – undo
242 245
 	 * @param string $fullname
243 246
 	 * @param string $role
244 247
 	 *
245
-	 * @return \Auth\Entity\UserInterface
248
+	 * @return \Core\Entity\EntityInterface
246 249
 	 */
247 250
 	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
248 251
 	{
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				try{
98 98
 					JobContext::removeJobByUser($user);
99 99
 					$repo->remove($user,true);
100
-				}catch (\Exception $e){
100
+				} catch (\Exception $e){
101 101
 				
102 102
 				}
103 103
 			}
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 			$organization->setOrganizationName($organizationName);
298 298
 			$permissions = $organization->getPermissions();
299 299
 			$permissions->grant($user,Permissions::PERMISSION_ALL);
300
-		}else {
300
+		} else {
301 301
 			$organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL);
302 302
 		}
303 303
 		$organization->setUser($user);
Please login to merge, or discard this patch.
Indentation   +332 added lines, -332 removed lines patch added patch discarded remove patch
@@ -37,384 +37,384 @@
 block discarded – undo
37 37
 {
38 38
     use CommonContextTrait;
39 39
 	
40
-	/**
41
-	 * @var User[]
42
-	 */
43
-	static private $users = [];
40
+    /**
41
+     * @var User[]
42
+     */
43
+    static private $users = [];
44 44
 	
45
-	/**
46
-	 * @var UserRepository
47
-	 */
48
-	static private $userRepo;
45
+    /**
46
+     * @var UserRepository
47
+     */
48
+    static private $userRepo;
49 49
 	
50
-	/**
51
-	 * @var string
52
-	 */
53
-	static private $currentSession;
50
+    /**
51
+     * @var string
52
+     */
53
+    static private $currentSession;
54 54
 	
55
-	private $socialLoginInfo = [];
55
+    private $socialLoginInfo = [];
56 56
 	
57
-	/**
58
-	 * @var UserInterface
59
-	 */
60
-	private $loggedInUser;
57
+    /**
58
+     * @var UserInterface
59
+     */
60
+    private $loggedInUser;
61 61
 
62 62
     /**
63 63
      * @var User
64 64
      */
65 65
     protected $currentUser;
66 66
 	
67
-	public function __construct($parameters=[])
68
-	{
69
-		$defaultLoginInfo = [
70
-			'facebook' => [
71
-				'email' => getenv('FACEBOOK_USER_EMAIL'),
72
-				'pass' => getenv('FACEBOOK_USER_PASSWORD')
73
-			],
74
-			'linkedin' => [
75
-				'session_key-login' => getenv('LINKEDIN_USER_EMAIL'),
76
-				'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
77
-			],
78
-		];
79
-		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
80
-		$this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
81
-	}
67
+    public function __construct($parameters=[])
68
+    {
69
+        $defaultLoginInfo = [
70
+            'facebook' => [
71
+                'email' => getenv('FACEBOOK_USER_EMAIL'),
72
+                'pass' => getenv('FACEBOOK_USER_PASSWORD')
73
+            ],
74
+            'linkedin' => [
75
+                'session_key-login' => getenv('LINKEDIN_USER_EMAIL'),
76
+                'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
77
+            ],
78
+        ];
79
+        $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
80
+        $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
81
+    }
82 82
 
83
-	/**
84
-	 * @AfterSuite
85
-	 * @param AfterSuiteScope $scope
86
-	 */
87
-	static public function afterSuite(AfterSuiteScope $scope)
88
-	{
89
-		$repo = static::$userRepo;
90
-		foreach(static::$users as $user){
91
-			if($repo->findByLogin($user->getLogin())){
92
-				try{
93
-					JobContext::removeJobByUser($user);
94
-					$repo->remove($user,true);
95
-				}catch (\Exception $e){
83
+    /**
84
+     * @AfterSuite
85
+     * @param AfterSuiteScope $scope
86
+     */
87
+    static public function afterSuite(AfterSuiteScope $scope)
88
+    {
89
+        $repo = static::$userRepo;
90
+        foreach(static::$users as $user){
91
+            if($repo->findByLogin($user->getLogin())){
92
+                try{
93
+                    JobContext::removeJobByUser($user);
94
+                    $repo->remove($user,true);
95
+                }catch (\Exception $e){
96 96
 				
97
-				}
98
-			}
99
-		}
100
-	}
97
+                }
98
+            }
99
+        }
100
+    }
101 101
 	
102
-	/**
103
-	 * @BeforeScenario
104
-	 * @param BeforeScenarioScope $scope
105
-	 */
106
-	public function beforeScenario(BeforeScenarioScope $scope)
107
-	{
108
-		$this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
109
-		$this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
110
-		static::$userRepo = $this->getUserRepository();
111
-	}
102
+    /**
103
+     * @BeforeScenario
104
+     * @param BeforeScenarioScope $scope
105
+     */
106
+    public function beforeScenario(BeforeScenarioScope $scope)
107
+    {
108
+        $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class);
109
+        $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class);
110
+        static::$userRepo = $this->getUserRepository();
111
+    }
112 112
 	
113
-	/**
114
-	 * @When I fill in login form with :provider user
115
-	 */
116
-	public function iSignInWithSocialUser($provider)
117
-	{
118
-		$provider = strtolower($provider);
119
-		$mink = $this->minkContext;
120
-		foreach($this->socialLoginInfo[$provider] as $field=>$value){
121
-			$mink->fillField($field,$value);
122
-		}
123
-	}
113
+    /**
114
+     * @When I fill in login form with :provider user
115
+     */
116
+    public function iSignInWithSocialUser($provider)
117
+    {
118
+        $provider = strtolower($provider);
119
+        $mink = $this->minkContext;
120
+        foreach($this->socialLoginInfo[$provider] as $field=>$value){
121
+            $mink->fillField($field,$value);
122
+        }
123
+    }
124 124
 	
125
-	/**
126
-	 * @Given I am logged in as a recruiter
127
-	 * @Given I am logged in as a recruiter with :organization as organization
128
-	 */
129
-	public function iAmLoggedInAsARecruiter($organization=null)
130
-	{
131
-		$user = $this->thereIsAUserIdentifiedBy(
132
-			'[email protected]',
133
-			'test',User::ROLE_RECRUITER,
134
-			'Test Recruiter',
135
-			$organization
136
-		);
137
-		$this->startLogin($user,'test');
138
-	}
125
+    /**
126
+     * @Given I am logged in as a recruiter
127
+     * @Given I am logged in as a recruiter with :organization as organization
128
+     */
129
+    public function iAmLoggedInAsARecruiter($organization=null)
130
+    {
131
+        $user = $this->thereIsAUserIdentifiedBy(
132
+            '[email protected]',
133
+            'test',User::ROLE_RECRUITER,
134
+            'Test Recruiter',
135
+            $organization
136
+        );
137
+        $this->startLogin($user,'test');
138
+    }
139 139
 	
140
-	/**
141
-	 * @Given I don't have :login user
142
-	 * @param string $login
143
-	 */
144
-	public function iDonTHaveUser($login)
145
-	{
146
-		$repo = $this->getUserRepository();
147
-		$user=$repo->findByLogin($login);
148
-		if($user instanceof UserInterface){
149
-			$repo->remove($user,true);
150
-		}
151
-	}
140
+    /**
141
+     * @Given I don't have :login user
142
+     * @param string $login
143
+     */
144
+    public function iDonTHaveUser($login)
145
+    {
146
+        $repo = $this->getUserRepository();
147
+        $user=$repo->findByLogin($login);
148
+        if($user instanceof UserInterface){
149
+            $repo->remove($user,true);
150
+        }
151
+    }
152 152
 	
153
-	/**
154
-	 * @Given I have a :role with the following:
155
-	 * @param $role
156
-	 * @param TableNode $fields
157
-	 */
158
-	public function iHaveUserWithTheFollowing($role,TableNode $fields)
159
-	{
160
-		$normalizedFields = [
161
-			'login' => '[email protected]',
162
-			'fullname' => 'Test Login',
163
-			'role' => User::ROLE_USER,
164
-			'password' => 'test',
165
-			'organization' => 'Cross Solution'
166
-		];
167
-		foreach($fields->getRowsHash() as $field=>$value){
168
-			$field = Inflector::camelize($field);
169
-			$normalizedFields[$field] = $value;
170
-		}
153
+    /**
154
+     * @Given I have a :role with the following:
155
+     * @param $role
156
+     * @param TableNode $fields
157
+     */
158
+    public function iHaveUserWithTheFollowing($role,TableNode $fields)
159
+    {
160
+        $normalizedFields = [
161
+            'login' => '[email protected]',
162
+            'fullname' => 'Test Login',
163
+            'role' => User::ROLE_USER,
164
+            'password' => 'test',
165
+            'organization' => 'Cross Solution'
166
+        ];
167
+        foreach($fields->getRowsHash() as $field=>$value){
168
+            $field = Inflector::camelize($field);
169
+            $normalizedFields[$field] = $value;
170
+        }
171 171
 		
172
-		$this->thereIsAUserIdentifiedBy(
173
-			$normalizedFields['login'],
174
-			$normalizedFields['password'],
175
-			$role,
176
-			$normalizedFields['fullname'],
177
-			$normalizedFields['organization']
178
-		);
172
+        $this->thereIsAUserIdentifiedBy(
173
+            $normalizedFields['login'],
174
+            $normalizedFields['password'],
175
+            $role,
176
+            $normalizedFields['fullname'],
177
+            $normalizedFields['organization']
178
+        );
179 179
 		
180
-	}
180
+    }
181 181
 	
182
-	/**
183
-	 * @Given I am logged in as an administrator
184
-	 */
185
-	public function iAmLoggedInAsAnAdmin()
186
-	{
187
-		$user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
188
-		$this->startLogin($user,'test');
189
-	}
182
+    /**
183
+     * @Given I am logged in as an administrator
184
+     */
185
+    public function iAmLoggedInAsAnAdmin()
186
+    {
187
+        $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
188
+        $this->startLogin($user,'test');
189
+    }
190 190
 	
191
-	private function startLogin(UserInterface $user, $password)
192
-	{
193
-		$currentUser = $this->currentUser;
194
-		if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
195
-			$this->iWantToLogIn();
196
-			$this->iSpecifyTheUsernameAs($user->getLogin());
197
-			$this->iSpecifyThePasswordAs($password);
198
-			$this->iLogIn();
199
-			$this->currentUser = $user;
200
-		}
201
-	}
191
+    private function startLogin(UserInterface $user, $password)
192
+    {
193
+        $currentUser = $this->currentUser;
194
+        if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
195
+            $this->iWantToLogIn();
196
+            $this->iSpecifyTheUsernameAs($user->getLogin());
197
+            $this->iSpecifyThePasswordAs($password);
198
+            $this->iLogIn();
199
+            $this->currentUser = $user;
200
+        }
201
+    }
202 202
 	
203
-	/**
204
-	 * @return UserRepository
205
-	 */
206
-	public function getUserRepository()
207
-	{
208
-		return $this->coreContext->getRepositories()->get('Auth\Entity\User');
209
-	}
203
+    /**
204
+     * @return UserRepository
205
+     */
206
+    public function getUserRepository()
207
+    {
208
+        return $this->coreContext->getRepositories()->get('Auth\Entity\User');
209
+    }
210 210
 	
211
-	/**
212
-	 * @Given there is a user :email identified by :password
213
-	 */
214
-	public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
215
-	{
216
-		$repo = $this->getUserRepository();
217
-		if(!is_object($user=$repo->findByEmail($email))){
218
-			$user = $this->createUser($email,$password,$role,$fullname,$organization);
219
-		}
211
+    /**
212
+     * @Given there is a user :email identified by :password
213
+     */
214
+    public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
215
+    {
216
+        $repo = $this->getUserRepository();
217
+        if(!is_object($user=$repo->findByEmail($email))){
218
+            $user = $this->createUser($email,$password,$role,$fullname,$organization);
219
+        }
220 220
 		
221
-		if(!is_null($organization)){
222
-			$this->iHaveMainOrganization($user,$organization);
223
-		}
224
-		$this->addCreatedUser($user);
225
-		return $user;
226
-	}
221
+        if(!is_null($organization)){
222
+            $this->iHaveMainOrganization($user,$organization);
223
+        }
224
+        $this->addCreatedUser($user);
225
+        return $user;
226
+    }
227 227
 	
228
-	/**
229
-	 * @param $email
230
-	 * @param $password
231
-	 * @param $username
232
-	 * @param string $fullname
233
-	 * @param string $role
234
-	 *
235
-	 * @return \Auth\Entity\UserInterface
236
-	 */
237
-	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
238
-	{
239
-		/* @var Register $service */
240
-		/* @var User $user */
241
-		$repo = $this->getUserRepository();
242
-		$user = $repo->create([]);
243
-		$user->setLogin($email);
244
-		$user->setPassword($password);
245
-		$user->setRole($role);
246
-		$settings = $user->getSettings('Applications');
228
+    /**
229
+     * @param $email
230
+     * @param $password
231
+     * @param $username
232
+     * @param string $fullname
233
+     * @param string $role
234
+     *
235
+     * @return \Auth\Entity\UserInterface
236
+     */
237
+    public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
238
+    {
239
+        /* @var Register $service */
240
+        /* @var User $user */
241
+        $repo = $this->getUserRepository();
242
+        $user = $repo->create([]);
243
+        $user->setLogin($email);
244
+        $user->setPassword($password);
245
+        $user->setRole($role);
246
+        $settings = $user->getSettings('Applications');
247 247
 		
248
-		$expFullName = explode(' ',$fullname);
249
-		$info = $user->getInfo();
250
-		$info->setFirstName(array_shift($expFullName));
251
-		$info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
252
-		$info->setEmail($email);
253
-		$info->setEmailVerified(true);
254
-		$repo->store($user);
255
-		$repo->getDocumentManager()->refresh($user);
248
+        $expFullName = explode(' ',$fullname);
249
+        $info = $user->getInfo();
250
+        $info->setFirstName(array_shift($expFullName));
251
+        $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
252
+        $info->setEmail($email);
253
+        $info->setEmailVerified(true);
254
+        $repo->store($user);
255
+        $repo->getDocumentManager()->refresh($user);
256 256
 		
257
-		$eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager());
258
-		$repo->getDocumentManager()->getEventManager()->dispatchEvent(
259
-			Events::postLoad,
260
-			$eventArgs
261
-		);
262
-		/* @var \Core\EventManager\EventManager $events */
263
-		/* @var \Auth\Listener\Events\AuthEvent $event */
264
-		//@TODO: [Behat] event not working in travis
265
-		//$events = $this->coreContext->getEventManager();
266
-		//$event  = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this);
267
-		//$event->setUser($user);
268
-		//$events->triggerEvent($event);
269
-		return $user;
270
-	}
257
+        $eventArgs = new LifecycleEventArgs($user, $repo->getDocumentManager());
258
+        $repo->getDocumentManager()->getEventManager()->dispatchEvent(
259
+            Events::postLoad,
260
+            $eventArgs
261
+        );
262
+        /* @var \Core\EventManager\EventManager $events */
263
+        /* @var \Auth\Listener\Events\AuthEvent $event */
264
+        //@TODO: [Behat] event not working in travis
265
+        //$events = $this->coreContext->getEventManager();
266
+        //$event  = $events->getEvent(AuthEvent::EVENT_USER_REGISTERED, $this);
267
+        //$event->setUser($user);
268
+        //$events->triggerEvent($event);
269
+        return $user;
270
+    }
271 271
 	
272
-	/**
273
-	 * @When I have :organization as my main organization
274
-	 * @param $orgName
275
-	 */
276
-	public function iHaveMainOrganization(UserInterface $user,$orgName)
277
-	{
278
-		/* @var $repoOrganization OrganizationRepository */
279
-		$repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
280
-		$organization=$repoOrganization->findByName($orgName);
281
-		if(!$organization instanceof Organization){
282
-			$organization = new Organization();
283
-			$organizationName = new OrganizationName($orgName);
284
-			$organization->setOrganizationName($organizationName);
285
-			$permissions = $organization->getPermissions();
286
-			$permissions->grant($user,Permissions::PERMISSION_ALL);
287
-		}else {
288
-			$organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL);
289
-		}
290
-		$organization->setUser($user);
291
-		$repoOrganization->store($organization);
292
-		$repoOrganization->getDocumentManager()->refresh($organization);
293
-	}
272
+    /**
273
+     * @When I have :organization as my main organization
274
+     * @param $orgName
275
+     */
276
+    public function iHaveMainOrganization(UserInterface $user,$orgName)
277
+    {
278
+        /* @var $repoOrganization OrganizationRepository */
279
+        $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
280
+        $organization=$repoOrganization->findByName($orgName);
281
+        if(!$organization instanceof Organization){
282
+            $organization = new Organization();
283
+            $organizationName = new OrganizationName($orgName);
284
+            $organization->setOrganizationName($organizationName);
285
+            $permissions = $organization->getPermissions();
286
+            $permissions->grant($user,Permissions::PERMISSION_ALL);
287
+        }else {
288
+            $organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL);
289
+        }
290
+        $organization->setUser($user);
291
+        $repoOrganization->store($organization);
292
+        $repoOrganization->getDocumentManager()->refresh($organization);
293
+    }
294 294
 	
295
-	/**
296
-	 * @When I want to log in
297
-	 */
298
-	public function iWantToLogIn()
299
-	{
300
-		$session = $this->minkContext->getSession();
301
-		$url = $this->generateUrl('lang/auth');
302
-		$session->visit($url);
303
-	}
295
+    /**
296
+     * @When I want to log in
297
+     */
298
+    public function iWantToLogIn()
299
+    {
300
+        $session = $this->minkContext->getSession();
301
+        $url = $this->generateUrl('lang/auth');
302
+        $session->visit($url);
303
+    }
304 304
 	
305
-	/**
306
-	 * @When I specify the username as :username
307
-	 */
308
-	public function iSpecifyTheUsernameAs($username)
309
-	{
310
-		$this->minkContext->fillField('Login name',$username);
311
-	}
305
+    /**
306
+     * @When I specify the username as :username
307
+     */
308
+    public function iSpecifyTheUsernameAs($username)
309
+    {
310
+        $this->minkContext->fillField('Login name',$username);
311
+    }
312 312
 	
313
-	/**
314
-	 * @When I specify the password as :password
315
-	 */
316
-	public function iSpecifyThePasswordAs($password)
317
-	{
318
-		$this->minkContext->fillField('Password',$password);
319
-	}
313
+    /**
314
+     * @When I specify the password as :password
315
+     */
316
+    public function iSpecifyThePasswordAs($password)
317
+    {
318
+        $this->minkContext->fillField('Password',$password);
319
+    }
320 320
 	
321
-	/**
322
-	 * @Given I am logged in as :username identified by :password
323
-	 */
324
-	public function iAmLoggedInAsIdentifiedBy($username, $password)
325
-	{
326
-		$repo = $this->getUserRepository();
327
-		$user = $repo->findByLogin($username);
321
+    /**
322
+     * @Given I am logged in as :username identified by :password
323
+     */
324
+    public function iAmLoggedInAsIdentifiedBy($username, $password)
325
+    {
326
+        $repo = $this->getUserRepository();
327
+        $user = $repo->findByLogin($username);
328 328
 		
329
-		if(!$user instanceof User){
330
-			throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
331
-		}
332
-		$this->iWantToLogIn();
333
-		$this->iSpecifyTheUsernameAs($username);
334
-		$this->iSpecifyThePasswordAs($password);
335
-		$this->iLogIn();
329
+        if(!$user instanceof User){
330
+            throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
331
+        }
332
+        $this->iWantToLogIn();
333
+        $this->iSpecifyTheUsernameAs($username);
334
+        $this->iSpecifyThePasswordAs($password);
335
+        $this->iLogIn();
336 336
         $this->currentUser = $user;
337
-	}
337
+    }
338 338
 	
339
-	/**
340
-	 * @When I log in
341
-	 */
342
-	public function iLogIn()
343
-	{
344
-		$this->minkContext->pressButton('login');
345
-	}
339
+    /**
340
+     * @When I log in
341
+     */
342
+    public function iLogIn()
343
+    {
344
+        $this->minkContext->pressButton('login');
345
+    }
346 346
 	
347
-	/**
348
-	 * @When I press logout link
349
-	 */
350
-	public function iPressLogoutLink()
351
-	{
352
-		$url = $this->generateUrl('auth-logout');
353
-		$this->visit($url);
354
-	}
347
+    /**
348
+     * @When I press logout link
349
+     */
350
+    public function iPressLogoutLink()
351
+    {
352
+        $url = $this->generateUrl('auth-logout');
353
+        $this->visit($url);
354
+    }
355 355
 	
356
-	/**
357
-	 * @Given I log in with username :username and password :password
358
-	 */
359
-	public function iLogInWith($username, $password)
360
-	{
361
-		$repo = $this->getUserRepository();
362
-		$user = $repo->findByLogin($username);
363
-		$this->iWantToLogIn();
364
-		$this->iSpecifyTheUsernameAs($username);
365
-		$this->iSpecifyThePasswordAs($password);
366
-		$this->iLogIn();
367
-		$this->loggedInUser = $user;
368
-	}
356
+    /**
357
+     * @Given I log in with username :username and password :password
358
+     */
359
+    public function iLogInWith($username, $password)
360
+    {
361
+        $repo = $this->getUserRepository();
362
+        $user = $repo->findByLogin($username);
363
+        $this->iWantToLogIn();
364
+        $this->iSpecifyTheUsernameAs($username);
365
+        $this->iSpecifyThePasswordAs($password);
366
+        $this->iLogIn();
367
+        $this->loggedInUser = $user;
368
+    }
369 369
 	
370
-	/**
371
-	 * @When I go to profile page
372
-	 */
373
-	public function iGoToProfilePage()
374
-	{
375
-		$url = $this->generateUrl('lang/my');
376
-		$this->visit($url);
377
-	}
370
+    /**
371
+     * @When I go to profile page
372
+     */
373
+    public function iGoToProfilePage()
374
+    {
375
+        $url = $this->generateUrl('lang/my');
376
+        $this->visit($url);
377
+    }
378 378
 	
379
-	/**
380
-	 * @Given there is a user with the following:
381
-	 */
382
-	public function thereIsAUserWithTheFollowing(TableNode $table)
383
-	{
384
-		$repo = $this->getUserRepository();
385
-		$data = $table->getRowsHash();
386
-		$email = isset($data['email']) ? $data['email']:'[email protected]';
387
-		$password = isset($data['password']) ? $data['password']:'test';
388
-		$fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
389
-		$role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
379
+    /**
380
+     * @Given there is a user with the following:
381
+     */
382
+    public function thereIsAUserWithTheFollowing(TableNode $table)
383
+    {
384
+        $repo = $this->getUserRepository();
385
+        $data = $table->getRowsHash();
386
+        $email = isset($data['email']) ? $data['email']:'[email protected]';
387
+        $password = isset($data['password']) ? $data['password']:'test';
388
+        $fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
389
+        $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
390 390
 		
391
-		if(!is_object($user=$repo->findByLogin($email))){
392
-			$user = $this->createUser($email,$password,$role,$fullname);
393
-		}
394
-		$this->currentUser = $user;
395
-		$this->addCreatedUser($user);
396
-	}
391
+        if(!is_object($user=$repo->findByLogin($email))){
392
+            $user = $this->createUser($email,$password,$role,$fullname);
393
+        }
394
+        $this->currentUser = $user;
395
+        $this->addCreatedUser($user);
396
+    }
397 397
 	
398
-	private function addCreatedUser(UserInterface $user)
399
-	{
400
-		if(!in_array($user,static::$users)){
401
-			static::$users[] = $user;
402
-		}
403
-	}
398
+    private function addCreatedUser(UserInterface $user)
399
+    {
400
+        if(!in_array($user,static::$users)){
401
+            static::$users[] = $user;
402
+        }
403
+    }
404 404
 	
405
-	/**
406
-	 * @When I want to change my password
407
-	 */
408
-	public function iWantToChangeMyPassword()
409
-	{
410
-		$url = $this->generateUrl('lang/my-password');
411
-		$this->visit($url);
412
-	}
405
+    /**
406
+     * @When I want to change my password
407
+     */
408
+    public function iWantToChangeMyPassword()
409
+    {
410
+        $url = $this->generateUrl('lang/my-password');
411
+        $this->visit($url);
412
+    }
413 413
 
414 414
     /**
415 415
      * @return User
416 416
      */
417
-	public function getCurrentUser()
417
+    public function getCurrentUser()
418 418
     {
419 419
         return $this->currentUser;
420 420
     }
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected $currentUser;
66 66
 	
67
-	public function __construct($parameters=[])
67
+	public function __construct($parameters = [])
68 68
 	{
69 69
 		$defaultLoginInfo = [
70 70
 			'facebook' => [
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 				'session_password-login' => getenv('LINKEDIN_USER_PASSWORD')
77 77
 			],
78 78
 		];
79
-		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[];
80
-		$this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig);
79
+		$socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : [];
80
+		$this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig);
81 81
 	}
82 82
 
83 83
 	/**
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 	static public function afterSuite(AfterSuiteScope $scope)
88 88
 	{
89 89
 		$repo = static::$userRepo;
90
-		foreach(static::$users as $user){
91
-			if($repo->findByLogin($user->getLogin())){
92
-				try{
90
+		foreach (static::$users as $user) {
91
+			if ($repo->findByLogin($user->getLogin())) {
92
+				try {
93 93
 					JobContext::removeJobByUser($user);
94
-					$repo->remove($user,true);
95
-				}catch (\Exception $e){
94
+					$repo->remove($user, true);
95
+				} catch (\Exception $e) {
96 96
 				
97 97
 				}
98 98
 			}
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 	{
118 118
 		$provider = strtolower($provider);
119 119
 		$mink = $this->minkContext;
120
-		foreach($this->socialLoginInfo[$provider] as $field=>$value){
121
-			$mink->fillField($field,$value);
120
+		foreach ($this->socialLoginInfo[$provider] as $field=>$value) {
121
+			$mink->fillField($field, $value);
122 122
 		}
123 123
 	}
124 124
 	
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
 	 * @Given I am logged in as a recruiter
127 127
 	 * @Given I am logged in as a recruiter with :organization as organization
128 128
 	 */
129
-	public function iAmLoggedInAsARecruiter($organization=null)
129
+	public function iAmLoggedInAsARecruiter($organization = null)
130 130
 	{
131 131
 		$user = $this->thereIsAUserIdentifiedBy(
132 132
 			'[email protected]',
133
-			'test',User::ROLE_RECRUITER,
133
+			'test', User::ROLE_RECRUITER,
134 134
 			'Test Recruiter',
135 135
 			$organization
136 136
 		);
137
-		$this->startLogin($user,'test');
137
+		$this->startLogin($user, 'test');
138 138
 	}
139 139
 	
140 140
 	/**
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 	public function iDonTHaveUser($login)
145 145
 	{
146 146
 		$repo = $this->getUserRepository();
147
-		$user=$repo->findByLogin($login);
148
-		if($user instanceof UserInterface){
149
-			$repo->remove($user,true);
147
+		$user = $repo->findByLogin($login);
148
+		if ($user instanceof UserInterface) {
149
+			$repo->remove($user, true);
150 150
 		}
151 151
 	}
152 152
 	
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 * @param $role
156 156
 	 * @param TableNode $fields
157 157
 	 */
158
-	public function iHaveUserWithTheFollowing($role,TableNode $fields)
158
+	public function iHaveUserWithTheFollowing($role, TableNode $fields)
159 159
 	{
160 160
 		$normalizedFields = [
161 161
 			'login' => '[email protected]',
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 			'password' => 'test',
165 165
 			'organization' => 'Cross Solution'
166 166
 		];
167
-		foreach($fields->getRowsHash() as $field=>$value){
167
+		foreach ($fields->getRowsHash() as $field=>$value) {
168 168
 			$field = Inflector::camelize($field);
169 169
 			$normalizedFields[$field] = $value;
170 170
 		}
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function iAmLoggedInAsAnAdmin()
186 186
 	{
187
-		$user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN);
188
-		$this->startLogin($user,'test');
187
+		$user = $this->thereIsAUserIdentifiedBy('[email protected]', 'test', User::ROLE_ADMIN);
188
+		$this->startLogin($user, 'test');
189 189
 	}
190 190
 	
191 191
 	private function startLogin(UserInterface $user, $password)
192 192
 	{
193 193
 		$currentUser = $this->currentUser;
194
-		if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){
194
+		if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) {
195 195
 			$this->iWantToLogIn();
196 196
 			$this->iSpecifyTheUsernameAs($user->getLogin());
197 197
 			$this->iSpecifyThePasswordAs($password);
@@ -211,15 +211,15 @@  discard block
 block discarded – undo
211 211
 	/**
212 212
 	 * @Given there is a user :email identified by :password
213 213
 	 */
214
-	public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null)
214
+	public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null)
215 215
 	{
216 216
 		$repo = $this->getUserRepository();
217
-		if(!is_object($user=$repo->findByEmail($email))){
218
-			$user = $this->createUser($email,$password,$role,$fullname,$organization);
217
+		if (!is_object($user = $repo->findByEmail($email))) {
218
+			$user = $this->createUser($email, $password, $role, $fullname, $organization);
219 219
 		}
220 220
 		
221
-		if(!is_null($organization)){
222
-			$this->iHaveMainOrganization($user,$organization);
221
+		if (!is_null($organization)) {
222
+			$this->iHaveMainOrganization($user, $organization);
223 223
 		}
224 224
 		$this->addCreatedUser($user);
225 225
 		return $user;
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	 *
235 235
 	 * @return \Auth\Entity\UserInterface
236 236
 	 */
237
-	public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter")
237
+	public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter")
238 238
 	{
239 239
 		/* @var Register $service */
240 240
 		/* @var User $user */
@@ -245,10 +245,10 @@  discard block
 block discarded – undo
245 245
 		$user->setRole($role);
246 246
 		$settings = $user->getSettings('Applications');
247 247
 		
248
-		$expFullName = explode(' ',$fullname);
248
+		$expFullName = explode(' ', $fullname);
249 249
 		$info = $user->getInfo();
250 250
 		$info->setFirstName(array_shift($expFullName));
251
-		$info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):'');
251
+		$info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : '');
252 252
 		$info->setEmail($email);
253 253
 		$info->setEmailVerified(true);
254 254
 		$repo->store($user);
@@ -273,19 +273,19 @@  discard block
 block discarded – undo
273 273
 	 * @When I have :organization as my main organization
274 274
 	 * @param $orgName
275 275
 	 */
276
-	public function iHaveMainOrganization(UserInterface $user,$orgName)
276
+	public function iHaveMainOrganization(UserInterface $user, $orgName)
277 277
 	{
278 278
 		/* @var $repoOrganization OrganizationRepository */
279 279
 		$repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization');
280
-		$organization=$repoOrganization->findByName($orgName);
281
-		if(!$organization instanceof Organization){
280
+		$organization = $repoOrganization->findByName($orgName);
281
+		if (!$organization instanceof Organization) {
282 282
 			$organization = new Organization();
283 283
 			$organizationName = new OrganizationName($orgName);
284 284
 			$organization->setOrganizationName($organizationName);
285 285
 			$permissions = $organization->getPermissions();
286
-			$permissions->grant($user,Permissions::PERMISSION_ALL);
287
-		}else {
288
-			$organization->getPermissions()->grant($user,Permissions::PERMISSION_ALL);
286
+			$permissions->grant($user, Permissions::PERMISSION_ALL);
287
+		} else {
288
+			$organization->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
289 289
 		}
290 290
 		$organization->setUser($user);
291 291
 		$repoOrganization->store($organization);
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 */
308 308
 	public function iSpecifyTheUsernameAs($username)
309 309
 	{
310
-		$this->minkContext->fillField('Login name',$username);
310
+		$this->minkContext->fillField('Login name', $username);
311 311
 	}
312 312
 	
313 313
 	/**
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	public function iSpecifyThePasswordAs($password)
317 317
 	{
318
-		$this->minkContext->fillField('Password',$password);
318
+		$this->minkContext->fillField('Password', $password);
319 319
 	}
320 320
 	
321 321
 	/**
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 		$repo = $this->getUserRepository();
327 327
 		$user = $repo->findByLogin($username);
328 328
 		
329
-		if(!$user instanceof User){
330
-			throw new \Exception(sprintf('There is no user with this login: "%s"',$username));
329
+		if (!$user instanceof User) {
330
+			throw new \Exception(sprintf('There is no user with this login: "%s"', $username));
331 331
 		}
332 332
 		$this->iWantToLogIn();
333 333
 		$this->iSpecifyTheUsernameAs($username);
@@ -383,13 +383,13 @@  discard block
 block discarded – undo
383 383
 	{
384 384
 		$repo = $this->getUserRepository();
385 385
 		$data = $table->getRowsHash();
386
-		$email = isset($data['email']) ? $data['email']:'[email protected]';
387
-		$password = isset($data['password']) ? $data['password']:'test';
388
-		$fullname = isset($data['fullname']) ? $data['fullname']:'Test User';
389
-		$role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER;
386
+		$email = isset($data['email']) ? $data['email'] : '[email protected]';
387
+		$password = isset($data['password']) ? $data['password'] : 'test';
388
+		$fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User';
389
+		$role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER;
390 390
 		
391
-		if(!is_object($user=$repo->findByLogin($email))){
392
-			$user = $this->createUser($email,$password,$role,$fullname);
391
+		if (!is_object($user = $repo->findByLogin($email))) {
392
+			$user = $this->createUser($email, $password, $role, $fullname);
393 393
 		}
394 394
 		$this->currentUser = $user;
395 395
 		$this->addCreatedUser($user);
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 	
398 398
 	private function addCreatedUser(UserInterface $user)
399 399
 	{
400
-		if(!in_array($user,static::$users)){
400
+		if (!in_array($user, static::$users)) {
401 401
 			static::$users[] = $user;
402 402
 		}
403 403
 	}
Please login to merge, or discard this patch.
module/Core/src/Core/Controller/Plugin/CreatePaginator.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,6 @@
 block discarded – undo
128 128
     }
129 129
     
130 130
     /**
131
-     * @param ControllerManager $controllerManager
132 131
      * @return CreatePaginator
133 132
      * @codeCoverageIgnore
134 133
      */
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected $request;
46 46
 	
47
-	/**
48
-	 * CreatePaginator constructor.
49
-	 *
50
-	 * @param ContainerInterface $container
51
-	 * @param HttpRequest $request
52
-	 */
47
+    /**
48
+     * CreatePaginator constructor.
49
+     *
50
+     * @param ContainerInterface $container
51
+     * @param HttpRequest $request
52
+     */
53 53
     public function __construct(ContainerInterface $container, HttpRequest $request)
54 54
     {
55 55
         $this->serviceManager = $container->get('ServiceManager');
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
         /* @var \Core\EventManager\EventManager $events */
106 106
         /* @var \Zend\Paginator\Paginator $paginator */
107 107
         /* @var CreatePaginatorEvent $event */
108
-	    $events = $this->serviceManager->get('Core/CreatePaginator/Events');
108
+        $events = $this->serviceManager->get('Core/CreatePaginator/Events');
109 109
 
110
-	    $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[
110
+        $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[
111 111
             'paginatorParams' => $params,
112 112
             'paginators' => $paginators,
113 113
             'paginatorName' => $paginatorName
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
             $paginator = $paginators->get($paginatorName,$params);
122 122
         }
123 123
         $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1)
124
-                  ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
125
-                  ->setPageRange(isset($params['range']) ? $params['range'] : 5);
124
+                    ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
125
+                    ->setPageRange(isset($params['range']) ? $params['range'] : 5);
126 126
 
127 127
         return $paginator;
128 128
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         /* @var CreatePaginatorEvent $event */
108 108
 	    $events = $this->serviceManager->get('Core/CreatePaginator/Events');
109 109
 
110
-	    $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[
110
+	    $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR, $this, [
111 111
             'paginatorParams' => $params,
112 112
             'paginators' => $paginators,
113 113
             'paginatorName' => $paginatorName
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
         $paginator = $event->getPaginator();
118 118
 
119
-        if(!$paginator instanceof Paginator){
119
+        if (!$paginator instanceof Paginator) {
120 120
             // no paginator created by listener, so let's create default paginator
121
-            $paginator = $paginators->get($paginatorName,$params);
121
+            $paginator = $paginators->get($paginatorName, $params);
122 122
         }
123 123
         $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1)
124 124
                   ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
Please login to merge, or discard this patch.
module/Core/src/Core/EventManager/EventManager.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
      *
61 61
      * If no event instance is passed, it creates one prior to triggering.
62 62
      *
63
-     * @param EventInterface|string $eventName
64
-     * @param object|string|null $target
63
+     * @param EventInterface $eventName
64
+     * @param \Core\Controller\AdminController $target
65 65
      * @param array $argv
66 66
      *
67 67
      * @return \Zend\EventManager\ResponseCollection
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
         return $event;
56 56
     }
57 57
 	
58
-	/**
59
-	 * Trigger an event.
58
+    /**
59
+     * Trigger an event.
60 60
      *
61 61
      * If no event instance is passed, it creates one prior to triggering.
62 62
      *
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param array $argv
66 66
      *
67 67
      * @return \Zend\EventManager\ResponseCollection
68
-	 */
68
+     */
69 69
     public function trigger($eventName, $target = null, $argv = [])
70 70
     {
71 71
         $event = $eventName instanceOf EventInterface
Please login to merge, or discard this patch.
module/Core/src/Core/Factory/Service/RestClientFactory.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     }
59 59
 
60 60
     /**
61
-     * @return mixed
61
+     * @return null|string
62 62
      */
63 63
     abstract protected function getUri();
64 64
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,15 +38,15 @@
 block discarded – undo
38 38
      */
39 39
     protected $serviceLocator;
40 40
 	
41
-	public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
42
-	{
43
-		$this->serviceLocator = $container;
44
-		$service = new RestClient($this->getUri(), $this->getConfig());
45
-		return $service;
46
-	}
41
+    public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
42
+    {
43
+        $this->serviceLocator = $container;
44
+        $service = new RestClient($this->getUri(), $this->getConfig());
45
+        return $service;
46
+    }
47 47
 	
48 48
 	
49
-	/**
49
+    /**
50 50
      * Create the settings service
51 51
      *
52 52
      * @param  ServiceLocatorInterface $serviceLocator
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     protected $serviceLocator;
40 40
 	
41
-	public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
41
+	public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
42 42
 	{
43 43
 		$this->serviceLocator = $container;
44 44
 		$service = new RestClient($this->getUri(), $this->getConfig());
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function createService(ServiceLocatorInterface $serviceLocator)
56 56
     {
57
-        return $this($serviceLocator,RestClient::class);
57
+        return $this($serviceLocator, RestClient::class);
58 58
     }
59 59
 
60 60
     /**
Please login to merge, or discard this patch.
module/Core/src/Core/I18n/LocaleFactory.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      * @param  string             $requestedName
32 32
      * @param  null|array         $options
33 33
      *
34
-     * @return object
34
+     * @return Locale
35 35
      * @throws ServiceNotFoundException if unable to resolve the service.
36 36
      * @throws ServiceNotCreatedException if an exception is raised when
37 37
      *     creating a service.
Please login to merge, or discard this patch.
module/Core/src/Core/Paginator/PaginatorFactoryAbstract.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,6 @@
 block discarded – undo
41 41
     }
42 42
 	
43 43
 	/**
44
-     * @param ContainerInterface $serviceLocator
45 44
      * @return mixed|Paginator
46 45
      */
47 46
     public function createService(ContainerInterface $container)
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,19 +28,19 @@
 block discarded – undo
28 28
 
29 29
     public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
30 30
     {
31
-	    /* @var PaginatorService $paginatorService */
32
-	    /* @var RepositoryService $repositories */
33
-	    $repositories   = $container->get('repositories');
34
-	    $repository     = $repositories->get($this->getRepository());
35
-	    $queryBuilder   = $repository->createQueryBuilder();
36
-	    $filter         = $container->get('FilterManager')->get($this->getFilter());
37
-	    $adapter        = new \Core\Paginator\Adapter\DoctrineMongoLateCursor($queryBuilder, $filter, $options);
38
-	    $service        = new Paginator($adapter);
31
+        /* @var PaginatorService $paginatorService */
32
+        /* @var RepositoryService $repositories */
33
+        $repositories   = $container->get('repositories');
34
+        $repository     = $repositories->get($this->getRepository());
35
+        $queryBuilder   = $repository->createQueryBuilder();
36
+        $filter         = $container->get('FilterManager')->get($this->getFilter());
37
+        $adapter        = new \Core\Paginator\Adapter\DoctrineMongoLateCursor($queryBuilder, $filter, $options);
38
+        $service        = new Paginator($adapter);
39 39
 	
40
-	    return $service;
40
+        return $service;
41 41
     }
42 42
 	
43
-	/**
43
+    /**
44 44
      * @param ContainerInterface $serviceLocator
45 45
      * @return mixed|Paginator
46 46
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 abstract class PaginatorFactoryAbstract implements FactoryInterface
27 27
 {
28 28
 
29
-    public function __invoke( ContainerInterface $container, $requestedName, array $options = null )
29
+    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
30 30
     {
31 31
 	    /* @var PaginatorService $paginatorService */
32 32
 	    /* @var RepositoryService $repositories */
Please login to merge, or discard this patch.
module/Core/src/Core/View/Helper/Services.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,6 @@
 block discarded – undo
86 86
     }
87 87
     
88 88
     /**
89
-     * @param HelperPluginManager $helperPluginManager
90 89
      * @return Services
91 90
      */
92 91
     public static function factory($sm)
Please login to merge, or discard this patch.
config/common.modules.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,23 +11,23 @@
 block discarded – undo
11 11
  */
12 12
 
13 13
 return array(
14
-	'Zend\ServiceManager\Di',
15
-	'Zend\Session',
16
-	'Zend\Router',
17
-	'Zend\Navigation',
18
-	'Zend\I18n',
19
-	'Zend\Filter',
20
-	'Zend\InputFilter',
21
-	'Zend\Form',
22
-	'Zend\Validator',
23
-	'Zend\Log',
24
-	'Zend\Mvc\Plugin\Prg',
25
-	'Zend\Mvc\Plugin\Identity',
26
-	'Zend\Mvc\Plugin\FlashMessenger',
27
-	'Zend\Mvc\I18n',
28
-	'Zend\Mvc\Console',
29
-	'Zend\Hydrator',
30
-	'Zend\Serializer',
31
-	'DoctrineModule',
32
-	'DoctrineMongoODMModule',
14
+    'Zend\ServiceManager\Di',
15
+    'Zend\Session',
16
+    'Zend\Router',
17
+    'Zend\Navigation',
18
+    'Zend\I18n',
19
+    'Zend\Filter',
20
+    'Zend\InputFilter',
21
+    'Zend\Form',
22
+    'Zend\Validator',
23
+    'Zend\Log',
24
+    'Zend\Mvc\Plugin\Prg',
25
+    'Zend\Mvc\Plugin\Identity',
26
+    'Zend\Mvc\Plugin\FlashMessenger',
27
+    'Zend\Mvc\I18n',
28
+    'Zend\Mvc\Console',
29
+    'Zend\Hydrator',
30
+    'Zend\Serializer',
31
+    'DoctrineModule',
32
+    'DoctrineMongoODMModule',
33 33
 );
34 34
\ No newline at end of file
Please login to merge, or discard this patch.
module/Install/src/Tracy.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,18 +26,18 @@
 block discarded – undo
26 26
      */
27 27
     public function register(array $config)
28 28
     {
29
-    	try{
30
-		    // enable logging of all error types globally
31
-		    Debugger::enable($config['mode'], $config['log'], $config['email']);
32
-		    Debugger::$strictMode = $config['strict'];
33
-		    Debugger::$showBar = $config['bar'];
29
+        try{
30
+            // enable logging of all error types globally
31
+            Debugger::enable($config['mode'], $config['log'], $config['email']);
32
+            Debugger::$strictMode = $config['strict'];
33
+            Debugger::$showBar = $config['bar'];
34 34
 		
35
-		    /** @var \Tracy\Logger $logger */
36
-		    $logger = Debugger::getLogger();
37
-		    $logger->emailSnooze = $config['email_snooze'];
38
-	    }catch (\Exception $e){
39
-    		throw $e;
40
-	    }
35
+            /** @var \Tracy\Logger $logger */
36
+            $logger = Debugger::getLogger();
37
+            $logger->emailSnooze = $config['email_snooze'];
38
+        }catch (\Exception $e){
39
+            throw $e;
40
+        }
41 41
      
42 42
     }
43 43
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function register(array $config)
28 28
     {
29
-    	try{
29
+    	try {
30 30
 		    // enable logging of all error types globally
31 31
 		    Debugger::enable($config['mode'], $config['log'], $config['email']);
32 32
 		    Debugger::$strictMode = $config['strict'];
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		    /** @var \Tracy\Logger $logger */
36 36
 		    $logger = Debugger::getLogger();
37 37
 		    $logger->emailSnooze = $config['email_snooze'];
38
-	    }catch (\Exception $e){
38
+	    } catch (\Exception $e) {
39 39
     		throw $e;
40 40
 	    }
41 41
      
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 		    /** @var \Tracy\Logger $logger */
36 36
 		    $logger = Debugger::getLogger();
37 37
 		    $logger->emailSnooze = $config['email_snooze'];
38
-	    }catch (\Exception $e){
38
+	    } catch (\Exception $e){
39 39
     		throw $e;
40 40
 	    }
41 41
      
Please login to merge, or discard this patch.