@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | /* @var \Auth\Form\UserProfileContainer $userProfileContainer */ |
96 | 96 | $userProfileContainer = $this->userProfileContainer; |
97 | 97 | $user = $this->authService->getUser(); /* @var $user \Auth\Entity\User */ |
98 | - $postProfiles = (array)$this->params()->fromPost('social_profiles'); |
|
98 | + $postProfiles = (array) $this->params()->fromPost('social_profiles'); |
|
99 | 99 | $userProfiles = $user->getProfile(); |
100 | 100 | $formSocialProfiles = $this->socialProfileForm |
101 | 101 | ->setUseDefaultValidation(true) |
102 | - ->setData(['social_profiles' => array_map(function ($array) |
|
102 | + ->setData(['social_profiles' => array_map(function($array) |
|
103 | 103 | { |
104 | 104 | return $array['data']; |
105 | 105 | }, $userProfiles)]); |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | $form = $userProfileContainer->getForm($formName); |
119 | 119 | |
120 | 120 | if ($form) { |
121 | - $postData = $form->getOption('use_post_array') ? $_POST : array(); |
|
121 | + $postData = $form->getOption('use_post_array') ? $_POST : array(); |
|
122 | 122 | //@TODO: [ZF3] option use_files_array is false by default |
123 | 123 | //$filesData = $form->getOption('use_files_array') ? $_FILES : array(); |
124 | 124 | $filesData = $_FILES; |
125 | - $data = array_merge($postData, $filesData); |
|
125 | + $data = array_merge($postData, $filesData); |
|
126 | 126 | $form->setData($data); |
127 | 127 | |
128 | 128 | if (!$form->isValid()) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | )); |
184 | 184 | } else { |
185 | 185 | $profile = [ |
186 | - 'auth' => (array)$authProfile, |
|
186 | + 'auth' => (array) $authProfile, |
|
187 | 187 | 'data' => \Zend\Json\Json::decode($dataProfiles[$network]) |
188 | 188 | ]; |
189 | 189 | $user->addProfile($network, $profile); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | // keep data in sync & properly decoded |
196 | - $formSocialProfiles->setData(['social_profiles' => array_map(function ($array) |
|
196 | + $formSocialProfiles->setData(['social_profiles' => array_map(function($array) |
|
197 | 197 | { |
198 | 198 | return \Zend\Json\Json::decode($array) ?: ''; |
199 | 199 | }, $dataProfiles)]); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $this->options['allowName'] = isset($options['allowName']) ? $options['allowName'] : null; |
38 | 38 | } |
39 | 39 | |
40 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
40 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
41 | 41 | { |
42 | 42 | $auth = $container->get('AuthenticationService'); |
43 | 43 | $user = $auth->getUser(); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function setBirthDay($birthDay) |
140 | 140 | { |
141 | - $this->birthDay=$birthDay; |
|
141 | + $this->birthDay = $birthDay; |
|
142 | 142 | return $this; |
143 | 143 | } |
144 | 144 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function setBirthMonth($birthMonth) |
161 | 161 | { |
162 | - $this->birthMonth=$birthMonth; |
|
162 | + $this->birthMonth = $birthMonth; |
|
163 | 163 | return $this; |
164 | 164 | } |
165 | 165 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function setBirthYear($birthYear) |
182 | 182 | { |
183 | - $this->birthYear=$birthYear; |
|
183 | + $this->birthYear = $birthYear; |
|
184 | 184 | return $this; |
185 | 185 | } |
186 | 186 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function setEmail($email) |
203 | 203 | { |
204 | - $this->email = trim((String)$email); |
|
204 | + $this->email = trim((String) $email); |
|
205 | 205 | return $this; |
206 | 206 | } |
207 | 207 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function setFirstName($firstName) |
246 | 246 | { |
247 | - $this->firstName = trim((String)$firstName); |
|
247 | + $this->firstName = trim((String) $firstName); |
|
248 | 248 | return $this; |
249 | 249 | } |
250 | 250 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public function setGender($gender) |
268 | 268 | { |
269 | - $this->gender = trim((String)$gender); |
|
269 | + $this->gender = trim((String) $gender); |
|
270 | 270 | return $this; |
271 | 271 | } |
272 | 272 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function setHouseNumber($houseNumber) |
289 | 289 | { |
290 | - $this->houseNumber=$houseNumber; |
|
290 | + $this->houseNumber = $houseNumber; |
|
291 | 291 | return $this; |
292 | 292 | } |
293 | 293 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | if (!$this->lastName) { |
333 | 333 | return $emailIfEmpty ? $this->email : ''; |
334 | 334 | } |
335 | - return ($this->firstName ? $this->firstName . ' ' : '') . $this->lastName; |
|
335 | + return ($this->firstName ? $this->firstName.' ' : '').$this->lastName; |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | */ |
427 | 427 | public function setStreet($street) |
428 | 428 | { |
429 | - $this->street=$street; |
|
429 | + $this->street = $street; |
|
430 | 430 | return $this; |
431 | 431 | } |
432 | 432 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | */ |
448 | 448 | public function setCountry($country) |
449 | 449 | { |
450 | - $this->country=$country; |
|
450 | + $this->country = $country; |
|
451 | 451 | return $this; |
452 | 452 | } |
453 | 453 |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | $name = Inflector::camelize($name); |
40 | 40 | $type = $this->elementMap[$name]; |
41 | 41 | $locator = $type.' .sf-summary .sf-controls button'; |
42 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
43 | - if(!$element){ |
|
42 | + $element = $this->minkContext->getSession()->getPage()->find('css', $locator); |
|
43 | + if (!$element) { |
|
44 | 44 | throw new \Exception('No element found with this locator: "'.$locator.'"'); |
45 | 45 | } |
46 | 46 | $element->click(); |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | { |
71 | 71 | $type = Inflector::camelize($type); |
72 | 72 | $method = 'iSave'.$type; |
73 | - if(method_exists($this,$method)){ |
|
74 | - call_user_func([$this,$method]); |
|
75 | - }else{ |
|
73 | + if (method_exists($this, $method)) { |
|
74 | + call_user_func([$this, $method]); |
|
75 | + } else { |
|
76 | 76 | $locator = $this->elementMap[$type].'-buttons-submit'; |
77 | 77 | $this->coreContext->scrollIntoView($locator); |
78 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
78 | + $element = $this->minkContext->getSession()->getPage()->find('css', $locator); |
|
79 | 79 | $element->click(); |
80 | 80 | } |
81 | 81 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $locator = '#nameForm-buttons-submit'; |
86 | 86 | $this->coreContext->scrollIntoView($locator); |
87 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
87 | + $element = $this->minkContext->getSession()->getPage()->find('css', $locator); |
|
88 | 88 | $element->click(); |
89 | 89 | } |
90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function iSaveWorkflow() |
95 | 95 | { |
96 | 96 | $locator = '#workflowSettings-buttons-submit'; |
97 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
97 | + $element = $this->minkContext->getSession()->getPage()->find('css', $locator); |
|
98 | 98 | $element->click(); |
99 | 99 | } |
100 | 100 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | { |
103 | 103 | $locator = '#locationForm-buttons-submit'; |
104 | 104 | $this->coreContext->scrollIntoView($locator); |
105 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
105 | + $element = $this->minkContext->getSession()->getPage()->find('css', $locator); |
|
106 | 106 | $element->click(); |
107 | 107 | } |
108 | 108 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $locator = '#general-classifications-buttons-submit'; |
113 | 113 | $this->coreContext->scrollIntoView($locator); |
114 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
114 | + $element = $this->minkContext->getSession()->getPage()->find('css', $locator); |
|
115 | 115 | $element->click(); |
116 | 116 | } |
117 | 117 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | { |
120 | 120 | $locator = '#general-customerNote-buttons-submit'; |
121 | 121 | $this->coreContext->scrollIntoView('#sf-general-customerNote'); |
122 | - $element = $this->minkContext->getSession()->getPage()->find('css',$locator); |
|
122 | + $element = $this->minkContext->getSession()->getPage()->find('css', $locator); |
|
123 | 123 | $element->click(); |
124 | 124 | } |
125 | 125 |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | |
32 | 32 | public function __construct() |
33 | 33 | { |
34 | - static::$configFile = getcwd() . '/config/autoload/install.module.php'; |
|
35 | - static::$yawikGlobalConfig = getcwd() . '/config/autoload/yawik.config.global.php'; |
|
34 | + static::$configFile = getcwd().'/config/autoload/install.module.php'; |
|
35 | + static::$yawikGlobalConfig = getcwd().'/config/autoload/yawik.config.global.php'; |
|
36 | 36 | static::$yawikBackupConfig = str_replace('yawik.config.global.php', 'yawik.backup', static::$yawikGlobalConfig); |
37 | 37 | } |
38 | 38 | |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | public function iHaveInstallModuleActivated() |
43 | 43 | { |
44 | 44 | $target = static::$configFile; |
45 | - if(!file_exists($target)){ |
|
45 | + if (!file_exists($target)) { |
|
46 | 46 | $source = __DIR__.'/../resources/install.module.php'; |
47 | - copy($source,$target); |
|
48 | - chmod($target,0777); |
|
47 | + copy($source, $target); |
|
48 | + chmod($target, 0777); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // backup existing file |
52 | 52 | $yawikBackupConfig = static::$yawikBackupConfig; |
53 | 53 | $yawikGlobalConfig = static::$yawikGlobalConfig; |
54 | 54 | |
55 | - if(is_file($yawikGlobalConfig)){ |
|
56 | - rename($yawikGlobalConfig,$yawikBackupConfig); |
|
55 | + if (is_file($yawikGlobalConfig)) { |
|
56 | + rename($yawikGlobalConfig, $yawikBackupConfig); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | static public function restoreConfig() |
94 | 94 | { |
95 | - if(is_file($file = static::$configFile)){ |
|
95 | + if (is_file($file = static::$configFile)) { |
|
96 | 96 | unlink($file); |
97 | 97 | } |
98 | 98 | |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | $yawikBackupConfig = static::$yawikBackupConfig; |
101 | 101 | $yawikGlobalConfig = static::$yawikGlobalConfig; |
102 | 102 | |
103 | - if(is_file($yawikBackupConfig)){ |
|
104 | - rename($yawikBackupConfig,$yawikGlobalConfig); |
|
103 | + if (is_file($yawikBackupConfig)) { |
|
104 | + rename($yawikBackupConfig, $yawikGlobalConfig); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
@@ -112,6 +112,6 @@ discard block |
||
112 | 112 | { |
113 | 113 | $config = $this->getService('config'); |
114 | 114 | $connection = $config['doctrine']['connection']['odm_default']['connectionString']; |
115 | - $this->minkContext->fillField('db_conn',$connection); |
|
115 | + $this->minkContext->fillField('db_conn', $connection); |
|
116 | 116 | } |
117 | 117 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $core = $scope->getEnvironment()->getContext(CoreContext::class); |
50 | 50 | /* @var FileTransport $transport */ |
51 | 51 | $transport = $core->getServiceManager()->get('Core/MailService')->getTransport(); |
52 | - $path = $transport->getOptions()->getPath() . '/*.eml'; |
|
52 | + $path = $transport->getOptions()->getPath().'/*.eml'; |
|
53 | 53 | foreach (glob($path) as $filename) { |
54 | 54 | unlink($filename); |
55 | 55 | } |
@@ -105,25 +105,25 @@ discard block |
||
105 | 105 | $regex = '/.*('.preg_quote($text).').*/im'; |
106 | 106 | $matches = []; |
107 | 107 | $multiMessages = false; |
108 | - if(count($this->messages) > 1){ |
|
108 | + if (count($this->messages) > 1) { |
|
109 | 109 | $multiMessages = true; |
110 | 110 | } |
111 | 111 | $content = ""; |
112 | - foreach($this->messages as $key=>$definition){ |
|
112 | + foreach ($this->messages as $key=>$definition) { |
|
113 | 113 | $content = $definition['contents']; |
114 | - if(preg_match($regex,$content,$match)){ |
|
114 | + if (preg_match($regex, $content, $match)) { |
|
115 | 115 | $matches[] = $match; |
116 | 116 | } |
117 | 117 | } |
118 | - $failMessage = sprintf('Can not find text "%s" in any email sent',$text); |
|
119 | - if(!$multiMessages){ |
|
118 | + $failMessage = sprintf('Can not find text "%s" in any email sent', $text); |
|
119 | + if (!$multiMessages) { |
|
120 | 120 | $failMessage = sprintf( |
121 | 121 | 'Can not find text "%s" in sent email. Here\'s the email content: %s', |
122 | 122 | $text, |
123 | 123 | PHP_EOL.PHP_EOL.$content |
124 | 124 | ); |
125 | 125 | } |
126 | - Assert::true(count($matches)>0,$failMessage); |
|
126 | + Assert::true(count($matches) > 0, $failMessage); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -136,16 +136,16 @@ discard block |
||
136 | 136 | |
137 | 137 | $path = $transport->getOptions()->getPath().'/*.eml'; |
138 | 138 | |
139 | - foreach(glob($path) as $filename){ |
|
139 | + foreach (glob($path) as $filename) { |
|
140 | 140 | $id = md5($filename); |
141 | - if(!isset($this->messages[$id])){ |
|
141 | + if (!isset($this->messages[$id])) { |
|
142 | 142 | $contents = file_get_contents($filename); |
143 | - $this->messages[$id] = $this->parseEmail($contents); |
|
143 | + $this->messages[$id] = $this->parseEmail($contents); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
147 | 147 | Assert::true( |
148 | - count($this->messages)>0, |
|
148 | + count($this->messages) > 0, |
|
149 | 149 | 'No email have been sent' |
150 | 150 | ); |
151 | 151 | } |
@@ -153,33 +153,33 @@ discard block |
||
153 | 153 | private function parseEmail($contents) |
154 | 154 | { |
155 | 155 | $addresses = $this->parseEmailAddress($contents); |
156 | - $subject =$this->parseSubject($contents); |
|
156 | + $subject = $this->parseSubject($contents); |
|
157 | 157 | |
158 | 158 | $contents = strip_tags($contents); |
159 | 159 | $contents = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $contents); |
160 | 160 | |
161 | - return array_merge($addresses,$subject,['contents' => $contents]); |
|
161 | + return array_merge($addresses, $subject, ['contents' => $contents]); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | private function parseEmailAddress($contents) |
165 | 165 | { |
166 | 166 | // pattern to get email address |
167 | - $radd = '(\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}\b)'; |
|
167 | + $radd = '(\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}\b)'; |
|
168 | 168 | |
169 | 169 | // get email from address |
170 | - $regex = sprintf('/^From\:.*%s/im',$radd); |
|
171 | - $hasMatch = preg_match($regex,$contents,$matches); |
|
172 | - $fromAddress = $hasMatch ? $matches[1]:null; |
|
170 | + $regex = sprintf('/^From\:.*%s/im', $radd); |
|
171 | + $hasMatch = preg_match($regex, $contents, $matches); |
|
172 | + $fromAddress = $hasMatch ? $matches[1] : null; |
|
173 | 173 | |
174 | 174 | // get email to address |
175 | - $regex = sprintf('/^To\:\s+%s/im',$radd); |
|
176 | - $hasMatch = preg_match($regex,$contents,$matches); |
|
177 | - $toAddress1 = $hasMatch ? $matches[1]:null; |
|
175 | + $regex = sprintf('/^To\:\s+%s/im', $radd); |
|
176 | + $hasMatch = preg_match($regex, $contents, $matches); |
|
177 | + $toAddress1 = $hasMatch ? $matches[1] : null; |
|
178 | 178 | |
179 | 179 | // get email to address |
180 | - $regex = sprintf('/^To\:.*%s/im',$radd); |
|
181 | - $hasMatch = preg_match($regex,$contents,$matches); |
|
182 | - $toAddress2 = $hasMatch ? $matches[1]:null; |
|
180 | + $regex = sprintf('/^To\:.*%s/im', $radd); |
|
181 | + $hasMatch = preg_match($regex, $contents, $matches); |
|
182 | + $toAddress2 = $hasMatch ? $matches[1] : null; |
|
183 | 183 | |
184 | 184 | $this->fromMails[] = $fromAddress; |
185 | 185 | $this->toMails[] = $toAddress1; |
@@ -187,15 +187,15 @@ discard block |
||
187 | 187 | |
188 | 188 | return [ |
189 | 189 | 'from' => $fromAddress, |
190 | - 'to' => [$toAddress1,$toAddress2], |
|
190 | + 'to' => [$toAddress1, $toAddress2], |
|
191 | 191 | ]; |
192 | 192 | } |
193 | 193 | |
194 | 194 | private function parseSubject($contents) |
195 | 195 | { |
196 | 196 | $pattern = '/Subject\:(.*)/i'; |
197 | - preg_match($pattern,$contents,$matches); |
|
198 | - $subject = isset($matches[1]) ? $matches[1]:null; |
|
197 | + preg_match($pattern, $contents, $matches); |
|
198 | + $subject = isset($matches[1]) ? $matches[1] : null; |
|
199 | 199 | $this->subjects[] = $subject; |
200 | 200 | return [ |
201 | 201 | 'subject' => trim($subject) |
@@ -51,16 +51,16 @@ |
||
51 | 51 | $this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class); |
52 | 52 | } |
53 | 53 | |
54 | - public function buildUrl($name, array $params=array(), array $options=array()) |
|
54 | + public function buildUrl($name, array $params = array(), array $options = array()) |
|
55 | 55 | { |
56 | 56 | $defaults = ['lang'=>'en']; |
57 | - $params = array_merge($defaults,$params); |
|
57 | + $params = array_merge($defaults, $params); |
|
58 | 58 | /* @var Url $urlHelper */ |
59 | 59 | $urlHelper = $this |
60 | 60 | ->getService('ViewHelperManager') |
61 | 61 | ->get('url') |
62 | 62 | ; |
63 | - $url = $urlHelper($name,$params,$options); |
|
63 | + $url = $urlHelper($name, $params, $options); |
|
64 | 64 | |
65 | 65 | return $this->coreContext->generateUrl($url); |
66 | 66 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function iGoToEmailTemplatePage() |
33 | 33 | { |
34 | - $url = $this->buildUrl('lang/settings',[ |
|
34 | + $url = $this->buildUrl('lang/settings', [ |
|
35 | 35 | 'module' => 'Applications' |
36 | 36 | ]); |
37 | 37 | $this->visit($url); |
@@ -35,13 +35,13 @@ |
||
35 | 35 | /* @var $repo JobRepository */ |
36 | 36 | $repo = $this->getRepository('Jobs/Job'); |
37 | 37 | $job = $repo->findOneBy(['title' => $title]); |
38 | - if(!$job instanceof Job){ |
|
38 | + if (!$job instanceof Job) { |
|
39 | 39 | throw new \Exception('There is no job titled: "'.$title.'"'); |
40 | 40 | } |
41 | 41 | $job->setApplyId($job->getId()); |
42 | 42 | $repo->store($job); |
43 | 43 | |
44 | - $url = $this->buildUrl('lang/apply',[ |
|
44 | + $url = $this->buildUrl('lang/apply', [ |
|
45 | 45 | 'applyId' => $job->getApplyId() |
46 | 46 | ]); |
47 | 47 | $this->visit($url); |