@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | public function iHaveOrganization($name) |
104 | 104 | { |
105 | 105 | $user = $this->getUserContext()->getCurrentUser(); |
106 | - $organization = $this->findOrganizationByName($name,false); |
|
106 | + $organization = $this->findOrganizationByName($name, false); |
|
107 | 107 | $repo = $this->getRepository('Organizations/Organization'); |
108 | - if(!$organization instanceof Organization){ |
|
108 | + if (!$organization instanceof Organization) { |
|
109 | 109 | |
110 | 110 | $organization = new Organization(); |
111 | 111 | $organizationName = new OrganizationName($name); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $organization->setParent($parent); |
119 | 119 | $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE); |
120 | 120 | $permissions = $organization->getPermissions(); |
121 | - $permissions->grant($user,Permissions::PERMISSION_ALL); |
|
121 | + $permissions->grant($user, Permissions::PERMISSION_ALL); |
|
122 | 122 | |
123 | 123 | $repo->store($organization); |
124 | 124 | $repo->getDocumentManager()->refresh($organization); |
@@ -128,19 +128,19 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * @Given organization :name have jobs: |
130 | 130 | */ |
131 | - public function organizationHavePublishedJob($name,TableNode $table) |
|
131 | + public function organizationHavePublishedJob($name, TableNode $table) |
|
132 | 132 | { |
133 | 133 | $user = $this->getUserContext()->getCurrentUser(); |
134 | - if(is_null($user)){ |
|
134 | + if (is_null($user)) { |
|
135 | 135 | throw new FailedExpectationException('Need to login first'); |
136 | 136 | } |
137 | 137 | |
138 | 138 | $organization = $this->findOrganizationByName($name); |
139 | - foreach($table->getColumnsHash() as $index=>$definitions){ |
|
139 | + foreach ($table->getColumnsHash() as $index=>$definitions) { |
|
140 | 140 | $definitions['user'] = $user->getLogin(); |
141 | - $status = isset($definitions['status']) ? $definitions['status']:'draft'; |
|
141 | + $status = isset($definitions['status']) ? $definitions['status'] : 'draft'; |
|
142 | 142 | unset($definitions['status']); |
143 | - $this->jobContext->buildJob($status,$definitions,$organization); |
|
143 | + $this->jobContext->buildJob($status, $definitions, $organization); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param $name |
150 | 150 | * @param $setting |
151 | 151 | */ |
152 | - public function profileSetting($name,$setting) |
|
152 | + public function profileSetting($name, $setting) |
|
153 | 153 | { |
154 | 154 | $repo = $this->getRepository('Organizations/Organization'); |
155 | 155 | $organization = $this->findOrganizationByName($name); |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | $contact = $organization->getContact(); |
170 | 170 | |
171 | 171 | $definitions = $table->getRowsHash(); |
172 | - foreach($definitions as $name=>$value){ |
|
172 | + foreach ($definitions as $name=>$value) { |
|
173 | 173 | $field = Inflector::camelize($name); |
174 | 174 | $method = 'set'.$field; |
175 | - $callback = array($contact,$method); |
|
176 | - if(is_callable($callback)){ |
|
177 | - call_user_func_array($callback,[$value]); |
|
175 | + $callback = array($contact, $method); |
|
176 | + if (is_callable($callback)) { |
|
177 | + call_user_func_array($callback, [$value]); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | $this->getRepository('Organizations/Organization')->store($organization); |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | * @param string $name |
187 | 187 | * @throws FailedExpectationException |
188 | 188 | */ |
189 | - public function iGoToOrganizationProfilePage($name=null) |
|
189 | + public function iGoToOrganizationProfilePage($name = null) |
|
190 | 190 | { |
191 | - if(is_null($name)){ |
|
191 | + if (is_null($name)) { |
|
192 | 192 | $organization = $this->getUserContext()->getCurrentUser()->getOrganization()->getOrganization(); |
193 | - }else{ |
|
193 | + } else { |
|
194 | 194 | $organization = $this->findOrganizationByName($name); |
195 | 195 | } |
196 | - $url = $this->buildUrl('lang/organizations/profileDetail',[ |
|
196 | + $url = $this->buildUrl('lang/organizations/profileDetail', [ |
|
197 | 197 | 'id' => $organization->getId() |
198 | 198 | ]); |
199 | 199 | |
@@ -210,10 +210,10 @@ discard block |
||
210 | 210 | /* @var OrganizationRepository $repo */ |
211 | 211 | $repo = $this->getRepository('Organizations/Organization'); |
212 | 212 | $result = $repo->findByName($name); |
213 | - $organization = count($result) > 0 ? $result[0]:null; |
|
214 | - if(!$organization instanceof Organization && $throwException){ |
|
213 | + $organization = count($result) > 0 ? $result[0] : null; |
|
214 | + if (!$organization instanceof Organization && $throwException) { |
|
215 | 215 | throw new FailedExpectationException( |
216 | - sprintf('Organization %s is not found.',$name) |
|
216 | + sprintf('Organization %s is not found.', $name) |
|
217 | 217 | ); |
218 | 218 | } |
219 | 219 | return $organization; |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | $jobRepo = $this->getRepository('Jobs/Job'); |
233 | 233 | $result = $jobRepo->findByOrganization($org->getId()); |
234 | 234 | |
235 | - foreach($result as $job){ |
|
236 | - $jobRepo->remove($job,true); |
|
235 | + foreach ($result as $job) { |
|
236 | + $jobRepo->remove($job, true); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | $user = $this->getUserContext()->getCurrentUser(); |
246 | 246 | $organization = $user->getOrganization()->getOrganization(); |
247 | - $url = $this->buildUrl('lang/organizations/edit',['id' => $organization->getId()]); |
|
247 | + $url = $this->buildUrl('lang/organizations/edit', ['id' => $organization->getId()]); |
|
248 | 248 | $this->visit($url); |
249 | 249 | } |
250 | 250 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | public function iAttachLogoFromFile($file) |
256 | 256 | { |
257 | 257 | $elementId = 'organizationLogo-original'; |
258 | - $this->minkContext->attachFileToField($elementId,$file); |
|
258 | + $this->minkContext->attachFileToField($elementId, $file); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | public function iRemoveLogoFromOrganization() |
265 | 265 | { |
266 | 266 | $elementId = '#organizationLogo-original-delete'; |
267 | - $element = $this->minkContext->getSession()->getPage()->find('css',$elementId); |
|
267 | + $element = $this->minkContext->getSession()->getPage()->find('css', $elementId); |
|
268 | 268 | $element->click(); |
269 | 269 | } |
270 | 270 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @see \Core\Repository\AbstractRepository::create() |
95 | 95 | * @return UserInterface |
96 | 96 | */ |
97 | - public function create(array $data = null, $persist=false) |
|
97 | + public function create(array $data = null, $persist = false) |
|
98 | 98 | { |
99 | 99 | $entity = parent::create($data); |
100 | 100 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function findByProfileIdentifier($identifier, $provider, array $options = []) |
118 | 118 | { |
119 | - return $this->findOneBy(array('profiles.' . $provider . '.auth.identifier' => $identifier), $options) ?: $this->findOneBy(array('profile.identifier' => $identifier), $options); |
|
119 | + return $this->findOneBy(array('profiles.'.$provider.'.auth.identifier' => $identifier), $options) ?: $this->findOneBy(array('profile.identifier' => $identifier), $options); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $qb->field('_id')->notEqual($curentUserId) |
134 | 134 | ->addAnd( |
135 | 135 | $qb->expr() |
136 | - ->addOr($qb->expr()->field('profiles.' . $provider . '.auth.identifier' )->equals($identifier)) |
|
136 | + ->addOr($qb->expr()->field('profiles.'.$provider.'.auth.identifier')->equals($identifier)) |
|
137 | 137 | ->addOr($qb->expr()->field('profile.identifier')->equals($identifier)) |
138 | 138 | ); |
139 | 139 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | return $this->findOneBy( |
190 | 190 | array( |
191 | 191 | '$or' => array( |
192 | - array('login' => $identity . $suffix), |
|
192 | + array('login' => $identity.$suffix), |
|
193 | 193 | array('info.email' => $identity) |
194 | 194 | ) |
195 | 195 | ) |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | public function findByQuery($query) |
239 | 239 | { |
240 | 240 | $qb = $this->createQueryBuilder(); |
241 | - $parts = explode(' ', trim($query)); |
|
241 | + $parts = explode(' ', trim($query)); |
|
242 | 242 | |
243 | 243 | foreach ($parts as $q) { |
244 | - $regex = new \MongoRegex('/^' . $query . '/i'); |
|
244 | + $regex = new \MongoRegex('/^'.$query.'/i'); |
|
245 | 245 | $qb->addOr($qb->expr()->field('info.firstName')->equals($regex)); |
246 | 246 | $qb->addOr($qb->expr()->field('info.lastName')->equals($regex)); |
247 | 247 | $qb->addOr($qb->expr()->field('info.email')->equals($regex)); |
@@ -80,9 +80,9 @@ |
||
80 | 80 | $repo->setEntityPrototype(new User()); |
81 | 81 | |
82 | 82 | $result = true; |
83 | - try{ |
|
83 | + try { |
|
84 | 84 | $repo->store($user); |
85 | - }catch (\Exception $e){ |
|
85 | + } catch (\Exception $e) { |
|
86 | 86 | throw $e; |
87 | 87 | } |
88 | 88 | return $result; |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | |
115 | 115 | $data = $form->getData(); |
116 | 116 | |
117 | - try{ |
|
117 | + try { |
|
118 | 118 | $options = [ |
119 | 119 | 'connection' => $data['db_conn'], |
120 | 120 | ]; |
121 | - $userOk = $this->plugin('Install/UserCreator',$options)->process($data['username'], $data['password'], $data['email']); |
|
121 | + $userOk = $this->plugin('Install/UserCreator', $options)->process($data['username'], $data['password'], $data['email']); |
|
122 | 122 | $ok = $this->plugin('Install/ConfigCreator')->process($data['db_conn'], $data['email']); |
123 | - }catch (\Exception $exception){ |
|
123 | + } catch (\Exception $exception) { |
|
124 | 124 | /* @TODO: provide a way to handle global error message */ |
125 | 125 | return $this->createJsonResponse([ |
126 | 126 | 'ok' => false, |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | parent::attachDefaultListeners(); |
154 | 154 | |
155 | 155 | $events = $this->getEventManager(); |
156 | - $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 ); |
|
156 | + $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 100); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | $config = $container->get('doctrine.documentmanager.odm_default')->getConfiguration(); |
52 | 52 | $config->setDefaultDB($database); |
53 | - $dm = $this->createDocumentManager($options['connection'],$config); |
|
53 | + $dm = $this->createDocumentManager($options['connection'], $config); |
|
54 | 54 | |
55 | - $plugin = new UserCreator($credentialFilter,$dm); |
|
55 | + $plugin = new UserCreator($credentialFilter, $dm); |
|
56 | 56 | return $plugin; |
57 | 57 | } |
58 | 58 | |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * @return DocumentManager |
65 | 65 | * @codeCoverageIgnore |
66 | 66 | */ |
67 | - public function createDocumentManager($connection,$config) |
|
67 | + public function createDocumentManager($connection, $config) |
|
68 | 68 | { |
69 | 69 | $dbConn = new Connection($connection); |
70 | - $dm = DocumentManager::create($dbConn,$config); |
|
70 | + $dm = DocumentManager::create($dbConn, $config); |
|
71 | 71 | return $dm; |
72 | 72 | } |
73 | 73 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | class JobEntityDependencyListener extends AbstractDependenciesListener |
27 | 27 | { |
28 | - protected $entityClasses = [ Job::class ]; |
|
28 | + protected $entityClasses = [Job::class]; |
|
29 | 29 | |
30 | 30 | protected function dependencyCheck(DependencyResultEvent $event) |
31 | 31 | { |
@@ -17,8 +17,8 @@ |
||
17 | 17 | } else { |
18 | 18 | echo '<p>Could not initialize autoloading. This happens, if the dependencies are not installed yet.</p>'; |
19 | 19 | echo '<p>Please try to install the dependencies via: </p>'; |
20 | - echo '<code>cd '. realpath('.') .'<br>./install.sh</code>'; |
|
21 | - echo '<p>exit at ' . __FILE__ . ' in line ' . __LINE__ .'</p>'; |
|
20 | + echo '<code>cd '.realpath('.').'<br>./install.sh</code>'; |
|
21 | + echo '<p>exit at '.__FILE__.' in line '.__LINE__.'</p>'; |
|
22 | 22 | exit; |
23 | 23 | } |
24 | 24 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | 'Core/MailServiceOptions' => [ |
16 | 16 | 'options' => [ |
17 | 17 | 'transportClass' => 'file', |
18 | - 'path' => realpath(__DIR__ . '/../../build/mails') |
|
18 | + 'path' => realpath(__DIR__.'/../../build/mails') |
|
19 | 19 | ], |
20 | 20 | ], |
21 | 21 | ] |
@@ -7,36 +7,36 @@ discard block |
||
7 | 7 | |
8 | 8 | return array( |
9 | 9 | 'hybridauth' => array( |
10 | - "Facebook" => array ( |
|
10 | + "Facebook" => array( |
|
11 | 11 | "enabled" => true, |
12 | - "keys" => array ( "id" => $FACEBOOK_APP_ID, "secret" => $FACEBOOK_APP_SECRET ), |
|
13 | - "scope" => "email, user_about_me, user_birthday, user_hometown, user_work_history, user_education_history",// optional |
|
12 | + "keys" => array("id" => $FACEBOOK_APP_ID, "secret" => $FACEBOOK_APP_SECRET), |
|
13 | + "scope" => "email, user_about_me, user_birthday, user_hometown, user_work_history, user_education_history", // optional |
|
14 | 14 | "display" => "popup" |
15 | 15 | |
16 | 16 | ), |
17 | - "LinkedIn" => array ( |
|
17 | + "LinkedIn" => array( |
|
18 | 18 | "enabled" => true, |
19 | - "keys" => array ( "id" => $LINKEDIN_APP_ID, "secret" => $LINKEDIN_APP_SECRET ), |
|
19 | + "keys" => array("id" => $LINKEDIN_APP_ID, "secret" => $LINKEDIN_APP_SECRET), |
|
20 | 20 | "scope" => "r_basicprofile,r_emailaddress" |
21 | 21 | ), |
22 | 22 | "XING" => array( |
23 | 23 | "enabled" => false, |
24 | - 'keys' => array ( "key" => '###XING APP KEY###', 'secret' => '### XING APP SECRET ###'), |
|
24 | + 'keys' => array("key" => '###XING APP KEY###', 'secret' => '### XING APP SECRET ###'), |
|
25 | 25 | "scope" => '' |
26 | 26 | ), |
27 | 27 | "Github" => array( |
28 | 28 | "enabled" => false, |
29 | - 'keys' => array ( "id" => '###Your GitHub AppID ###', 'secret' => '###Your GitHub Secret###'), |
|
29 | + 'keys' => array("id" => '###Your GitHub AppID ###', 'secret' => '###Your GitHub Secret###'), |
|
30 | 30 | "scope" => '' |
31 | 31 | ), |
32 | 32 | "Google" => array( |
33 | 33 | // see http://hybridauth.sourceforge.net/userguide/IDProvider_info_Google.html |
34 | 34 | "enabled" => false, |
35 | - 'keys' => array ( "id" => '###Your Google Client-ID ###', 'secret' => '###Your GitHub Secret###'), |
|
36 | - "scope" => "https://www.googleapis.com/auth/userinfo.profile ". // optional |
|
37 | - "https://www.googleapis.com/auth/userinfo.email" , // optional |
|
38 | - "access_type" => "offline", // optional |
|
39 | - "approval_prompt" => "force", // optional |
|
35 | + 'keys' => array("id" => '###Your Google Client-ID ###', 'secret' => '###Your GitHub Secret###'), |
|
36 | + "scope" => "https://www.googleapis.com/auth/userinfo.profile ".// optional |
|
37 | + "https://www.googleapis.com/auth/userinfo.email", // optional |
|
38 | + "access_type" => "offline", // optional |
|
39 | + "approval_prompt" => "force", // optional |
|
40 | 40 | ), |
41 | 41 | |
42 | 42 | |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | ), |
48 | 48 | |
49 | 49 | 'Auth' => array( |
50 | - 'first_login' => array ( |
|
51 | - 'role' => '%%role%%', // role set on the first login. |
|
52 | - 'auth_suffix' => '%%auth.suffix%%', // an auth suffix is needed, if you plan to add external apps. |
|
50 | + 'first_login' => array( |
|
51 | + 'role' => '%%role%%', // role set on the first login. |
|
52 | + 'auth_suffix' => '%%auth.suffix%%', // an auth suffix is needed, if you plan to add external apps. |
|
53 | 53 | ), |
54 | 54 | // this allows an external application to use the YAWIK API |
55 | 55 | // applications[USERPOSTFIX] => AppKey |