@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | private $loggedInUser; |
68 | 68 | |
69 | - public function __construct($parameters=[]) |
|
69 | + public function __construct($parameters = []) |
|
70 | 70 | { |
71 | 71 | $defaultLoginInfo = [ |
72 | 72 | 'facebook' => [ |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | 'session_password-login' => getenv('LINKEDIN_USER_PASSWORD') |
79 | 79 | ], |
80 | 80 | ]; |
81 | - $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info']:[]; |
|
82 | - $this->socialLoginInfo = array_merge($defaultLoginInfo,$socialLoginConfig); |
|
81 | + $socialLoginConfig = isset($parameters['social_login_info']) ? $parameters['social_login_info'] : []; |
|
82 | + $this->socialLoginInfo = array_merge($defaultLoginInfo, $socialLoginConfig); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | static public function afterSuite(AfterSuiteScope $scope) |
90 | 90 | { |
91 | 91 | $repo = static::$userRepo; |
92 | - foreach(static::$users as $user){ |
|
93 | - if($repo->findByLogin($user->getLogin())){ |
|
94 | - try{ |
|
92 | + foreach (static::$users as $user) { |
|
93 | + if ($repo->findByLogin($user->getLogin())) { |
|
94 | + try { |
|
95 | 95 | JobContext::removeJobByUser($user); |
96 | - $repo->remove($user,true); |
|
97 | - }catch (\Exception $e){ |
|
96 | + $repo->remove($user, true); |
|
97 | + } catch (\Exception $e) { |
|
98 | 98 | |
99 | 99 | } |
100 | 100 | } |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | { |
128 | 128 | $provider = strtolower($provider); |
129 | 129 | $mink = $this->minkContext; |
130 | - foreach($this->socialLoginInfo[$provider] as $field=>$value){ |
|
131 | - $mink->fillField($field,$value); |
|
130 | + foreach ($this->socialLoginInfo[$provider] as $field=>$value) { |
|
131 | + $mink->fillField($field, $value); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
@@ -136,15 +136,15 @@ discard block |
||
136 | 136 | * @Given I am logged in as a recruiter |
137 | 137 | * @Given I am logged in as a recruiter with :organization as organization |
138 | 138 | */ |
139 | - public function iAmLoggedInAsARecruiter($organization=null) |
|
139 | + public function iAmLoggedInAsARecruiter($organization = null) |
|
140 | 140 | { |
141 | 141 | $user = $this->thereIsAUserIdentifiedBy( |
142 | 142 | '[email protected]', |
143 | - 'test',User::ROLE_RECRUITER, |
|
143 | + 'test', User::ROLE_RECRUITER, |
|
144 | 144 | 'Test Recruiter', |
145 | 145 | $organization |
146 | 146 | ); |
147 | - $this->startLogin($user,'test'); |
|
147 | + $this->startLogin($user, 'test'); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | public function iDonTHaveUser($login) |
155 | 155 | { |
156 | 156 | $repo = $this->getUserRepository(); |
157 | - $user=$repo->findByLogin($login); |
|
158 | - if($user instanceof UserInterface){ |
|
159 | - $repo->remove($user,true); |
|
157 | + $user = $repo->findByLogin($login); |
|
158 | + if ($user instanceof UserInterface) { |
|
159 | + $repo->remove($user, true); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @param $role |
166 | 166 | * @param TableNode $fields |
167 | 167 | */ |
168 | - public function iHaveUserWithTheFollowing($role,TableNode $fields) |
|
168 | + public function iHaveUserWithTheFollowing($role, TableNode $fields) |
|
169 | 169 | { |
170 | 170 | $normalizedFields = [ |
171 | 171 | 'login' => '[email protected]', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | 'password' => 'test', |
175 | 175 | 'organization' => 'Cross Solution' |
176 | 176 | ]; |
177 | - foreach($fields->getRowsHash() as $field=>$value){ |
|
177 | + foreach ($fields->getRowsHash() as $field=>$value) { |
|
178 | 178 | $field = Inflector::camelize($field); |
179 | 179 | $normalizedFields[$field] = $value; |
180 | 180 | } |
@@ -194,14 +194,14 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function iAmLoggedInAsAnAdmin() |
196 | 196 | { |
197 | - $user = $this->thereIsAUserIdentifiedBy('[email protected]','test',User::ROLE_ADMIN); |
|
198 | - $this->startLogin($user,'test'); |
|
197 | + $user = $this->thereIsAUserIdentifiedBy('[email protected]', 'test', User::ROLE_ADMIN); |
|
198 | + $this->startLogin($user, 'test'); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | private function startLogin(UserInterface $user, $password) |
202 | 202 | { |
203 | 203 | $currentUser = $this->currentUser; |
204 | - if(!is_object($currentUser) || $user->getId()!=$currentUser->getId()){ |
|
204 | + if (!is_object($currentUser) || $user->getId() != $currentUser->getId()) { |
|
205 | 205 | $this->iWantToLogIn(); |
206 | 206 | $this->iSpecifyTheUsernameAs($user->getLogin()); |
207 | 207 | $this->iSpecifyThePasswordAs($password); |
@@ -221,15 +221,15 @@ discard block |
||
221 | 221 | /** |
222 | 222 | * @Given there is a user :email identified by :password |
223 | 223 | */ |
224 | - public function thereIsAUserIdentifiedBy($email, $password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter",$organization=null) |
|
224 | + public function thereIsAUserIdentifiedBy($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter", $organization = null) |
|
225 | 225 | { |
226 | 226 | $repo = $this->getUserRepository(); |
227 | - if(!is_object($user=$repo->findByEmail($email))){ |
|
228 | - $user = $this->createUser($email,$password,$role,$fullname,$organization); |
|
227 | + if (!is_object($user = $repo->findByEmail($email))) { |
|
228 | + $user = $this->createUser($email, $password, $role, $fullname, $organization); |
|
229 | 229 | } |
230 | 230 | |
231 | - if(!is_null($organization)){ |
|
232 | - $this->iHaveMainOrganization($user,$organization); |
|
231 | + if (!is_null($organization)) { |
|
232 | + $this->iHaveMainOrganization($user, $organization); |
|
233 | 233 | } |
234 | 234 | $this->addCreatedUser($user); |
235 | 235 | return $user; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * |
245 | 245 | * @return \Auth\Entity\UserInterface |
246 | 246 | */ |
247 | - public function createUser($email,$password,$role=User::ROLE_RECRUITER,$fullname="Test Recruiter") |
|
247 | + public function createUser($email, $password, $role = User::ROLE_RECRUITER, $fullname = "Test Recruiter") |
|
248 | 248 | { |
249 | 249 | /* @var Register $service */ |
250 | 250 | $repo = $this->getUserRepository(); |
@@ -253,10 +253,10 @@ discard block |
||
253 | 253 | $user->setPassword($password); |
254 | 254 | $user->setRole($role); |
255 | 255 | |
256 | - $expFullName = explode(' ',$fullname); |
|
256 | + $expFullName = explode(' ', $fullname); |
|
257 | 257 | $info = $user->getInfo(); |
258 | 258 | $info->setFirstName(array_shift($expFullName)); |
259 | - $info->setLastName(count($expFullName)>0 ? implode(' ',$expFullName):''); |
|
259 | + $info->setLastName(count($expFullName) > 0 ? implode(' ', $expFullName) : ''); |
|
260 | 260 | $info->setEmail($email); |
261 | 261 | $info->setEmailVerified(true); |
262 | 262 | $repo->store($user); |
@@ -274,12 +274,12 @@ discard block |
||
274 | 274 | * @When I have :organization as my main organization |
275 | 275 | * @param $orgName |
276 | 276 | */ |
277 | - public function iHaveMainOrganization(UserInterface $user,$orgName) |
|
277 | + public function iHaveMainOrganization(UserInterface $user, $orgName) |
|
278 | 278 | { |
279 | 279 | /* @var $repoOrganization OrganizationRepository */ |
280 | 280 | $repoOrganization = $this->coreContext->getRepositories()->get('Organizations/Organization'); |
281 | - $organization=$repoOrganization->findByName($orgName); |
|
282 | - if(!$organization instanceof Organization){ |
|
281 | + $organization = $repoOrganization->findByName($orgName); |
|
282 | + if (!$organization instanceof Organization) { |
|
283 | 283 | $organization = new Organization(); |
284 | 284 | $organizationName = new OrganizationName($orgName); |
285 | 285 | $organization->setOrganizationName($organizationName); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | public function iSpecifyTheUsernameAs($username) |
305 | 305 | { |
306 | - $this->minkContext->fillField('Login name',$username); |
|
306 | + $this->minkContext->fillField('Login name', $username); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | public function iSpecifyThePasswordAs($password) |
313 | 313 | { |
314 | - $this->minkContext->fillField('Password',$password); |
|
314 | + $this->minkContext->fillField('Password', $password); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -322,8 +322,8 @@ discard block |
||
322 | 322 | $repo = $this->getUserRepository(); |
323 | 323 | $user = $repo->findByLogin($username); |
324 | 324 | |
325 | - if(!$user instanceof User){ |
|
326 | - throw new \Exception(sprintf('There is no user with this login: "%s"',$username)); |
|
325 | + if (!$user instanceof User) { |
|
326 | + throw new \Exception(sprintf('There is no user with this login: "%s"', $username)); |
|
327 | 327 | } |
328 | 328 | $this->currentUser = $user; |
329 | 329 | $this->iWantToLogIn(); |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | { |
381 | 381 | $repo = $this->getUserRepository(); |
382 | 382 | $data = $table->getRowsHash(); |
383 | - $email = isset($data['email']) ? $data['email']:'[email protected]'; |
|
384 | - $password = isset($data['password']) ? $data['password']:'test'; |
|
385 | - $fullname = isset($data['fullname']) ? $data['fullname']:'Test User'; |
|
386 | - $role = isset($data['role']) ? $data['role']:User::ROLE_RECRUITER; |
|
383 | + $email = isset($data['email']) ? $data['email'] : '[email protected]'; |
|
384 | + $password = isset($data['password']) ? $data['password'] : 'test'; |
|
385 | + $fullname = isset($data['fullname']) ? $data['fullname'] : 'Test User'; |
|
386 | + $role = isset($data['role']) ? $data['role'] : User::ROLE_RECRUITER; |
|
387 | 387 | |
388 | - if(!is_object($user=$repo->findByLogin($email))){ |
|
389 | - $user = $this->createUser($email,$password,$role,$fullname); |
|
388 | + if (!is_object($user = $repo->findByLogin($email))) { |
|
389 | + $user = $this->createUser($email, $password, $role, $fullname); |
|
390 | 390 | } |
391 | 391 | $this->currentUser = $user; |
392 | 392 | $this->addCreatedUser($user); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | private function addCreatedUser(UserInterface $user) |
396 | 396 | { |
397 | - if(!in_array($user,static::$users)){ |
|
397 | + if (!in_array($user, static::$users)) { |
|
398 | 398 | static::$users[] = $user; |
399 | 399 | } |
400 | 400 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param EventManagerInterface $events |
47 | 47 | * @return $this |
48 | 48 | */ |
49 | - public function attach(EventManagerInterface $events, $priority=1) |
|
49 | + public function attach(EventManagerInterface $events, $priority = 1) |
|
50 | 50 | { |
51 | 51 | return $this; |
52 | 52 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $jsonLastError = json_last_error(); |
165 | 165 | if (json_last_error() != JSON_ERROR_NONE) { |
166 | 166 | // not able to decode json |
167 | - $log->info('RestCall Response not Json [errorCode: ' . $jsonLastError . ']: ' . var_export($body, true)); |
|
167 | + $log->info('RestCall Response not Json [errorCode: '.$jsonLastError.']: '.var_export($body, true)); |
|
168 | 168 | } else { |
169 | 169 | // does the provider want to have an own ID for Identification ? |
170 | 170 | $response_referenceUpdate = $decodedBody->referenceUpdate; |
@@ -174,10 +174,10 @@ discard block |
||
174 | 174 | $logInfo = 'RestCall changed externalID [' |
175 | 175 | . var_export($publisher->externalId, true) |
176 | 176 | . ' => ' |
177 | - . var_export($response_externalIdUpdate, true) . '], reference [' |
|
177 | + . var_export($response_externalIdUpdate, true).'], reference [' |
|
178 | 178 | . var_export($publisher->reference, true) |
179 | 179 | . ' => ' |
180 | - . var_export($response_referenceUpdate, true) . ']'; |
|
180 | + . var_export($response_referenceUpdate, true).']'; |
|
181 | 181 | $log->info($logInfo); |
182 | 182 | $publisher->reference = $response_referenceUpdate; |
183 | 183 | $publisher->externalId = $response_externalIdUpdate; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $this->options = array_merge($this->options, $options); |
63 | 63 | } |
64 | 64 | |
65 | - public function attach(EventManagerInterface $events, $priority=1) |
|
65 | + public function attach(EventManagerInterface $events, $priority = 1) |
|
66 | 66 | { |
67 | 67 | $this->listeners[] = $events->attach(JobEvent::EVENT_JOB_CREATED, array($this, 'onJobCreated')); |
68 | 68 | $this->listeners[] = $events->attach(JobEvent::EVENT_JOB_ACCEPTED, array($this, 'onJobAccepted')); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | protected $service; |
38 | 38 | |
39 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
39 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
40 | 40 | { |
41 | 41 | $this->service = $container; |
42 | 42 | return $this; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $filter->setViewHelperForm($viewHelperForm); |
62 | 62 | } |
63 | 63 | if (!isset($filter)) { |
64 | - throw new \InvalidArgumentException(get_class($element) . ' cannot be used to initialize a template'); |
|
64 | + throw new \InvalidArgumentException(get_class($element).' cannot be used to initialize a template'); |
|
65 | 65 | } |
66 | 66 | $viewManager = $this->service->get('ViewHelperManager'); |
67 | 67 | $basePathHelper = $viewManager->get('basePath'); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $filter->setImageFileCacheHelper($imageFileCacheHelper); |
72 | 72 | $filter->setServerUrlHelper($serverUrlHelper); |
73 | 73 | |
74 | - if($filter instanceof ViewModelTemplateFilterJob || method_exists($filter,'setJsonLdHelper')){ |
|
74 | + if ($filter instanceof ViewModelTemplateFilterJob || method_exists($filter, 'setJsonLdHelper')) { |
|
75 | 75 | $jsonLdHelper = $viewManager->get(JsonLd::class); |
76 | 76 | $filter->setJsonLdHelper($jsonLdHelper); |
77 | 77 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $params = $viewHelper->get('params'); |
48 | 48 | $serverUrl = $viewHelper->get('serverUrl'); |
49 | 49 | |
50 | - $helper = new JobUrl(); |
|
50 | + $helper = new JobUrl(); |
|
51 | 51 | $helper->setUrlHelper($url) |
52 | 52 | ->setParamsHelper($params) |
53 | 53 | ->setServerUrlHelper($serverUrl); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $params = $viewHelper->get('params'); |
45 | 45 | $serverUrl = $viewHelper->get('serverUrl'); |
46 | 46 | |
47 | - $helper = new ApplyUrl(); |
|
47 | + $helper = new ApplyUrl(); |
|
48 | 48 | $helper->setUrlHelper($url) |
49 | 49 | ->setTranslateHelper($translate) |
50 | 50 | ->setParamsHelper($params) |
@@ -33,8 +33,8 @@ |
||
33 | 33 | { |
34 | 34 | $auth = $container->get('AuthenticationService'); |
35 | 35 | /* @var RepositoryService $repositoryService */ |
36 | - $repositoryService = $container->get('repositories'); |
|
37 | - $translator = $container->get('translator'); |
|
36 | + $repositoryService = $container->get('repositories'); |
|
37 | + $translator = $container->get('translator'); |
|
38 | 38 | $filterManager = $container->get('FilterManager'); |
39 | 39 | $jobFormEvents = $container->get('Jobs/JobContainer/Events'); |
40 | 40 | $formManager = $container->get('FormElementManager'); |
@@ -26,15 +26,15 @@ |
||
26 | 26 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { |
27 | 27 | |
28 | 28 | /* @var \Jobs\Options\JobboardSearchOptions $options */ |
29 | - $options = $container->get( 'Jobs/JobboardSearchOptions' ); |
|
29 | + $options = $container->get('Jobs/JobboardSearchOptions'); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @var $jobRepository Repository\Job |
33 | 33 | */ |
34 | - $jobRepository = $container->get( 'repositories' )->get( 'Jobs/Job' ); |
|
35 | - $defaultListener = $container->get( 'DefaultListeners' ); |
|
36 | - $imageFileCacheManager = $container->get( 'Organizations\ImageFileCache\Manager' ); |
|
34 | + $jobRepository = $container->get('repositories')->get('Jobs/Job'); |
|
35 | + $defaultListener = $container->get('DefaultListeners'); |
|
36 | + $imageFileCacheManager = $container->get('Organizations\ImageFileCache\Manager'); |
|
37 | 37 | |
38 | - return new JobboardController( $defaultListener, $jobRepository, $imageFileCacheManager, [ 'count' => $options->getPerPage() ] ); |
|
38 | + return new JobboardController($defaultListener, $jobRepository, $imageFileCacheManager, ['count' => $options->getPerPage()]); |
|
39 | 39 | } |
40 | 40 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
67 | 67 | { |
68 | 68 | $factory = $this->getParentFactory(); |
69 | - $select = $factory($container,$requestedName); |
|
69 | + $select = $factory($container, $requestedName); |
|
70 | 70 | $select->setViewPartial('jobs/form/multiposting-checkboxes'); |
71 | 71 | $select->setHeadscripts(array('Jobs/js/form.multiposting-checkboxes.js')); |
72 | 72 | return $select; |