@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | |
14 | 14 | if (php_sapi_name() == 'cli-server') { |
15 | 15 | $parseUrl = parse_url(substr($_SERVER["REQUEST_URI"], 1)); |
16 | - $route = isset($parseUrl['path']) ? $parseUrl['path']:null; |
|
17 | - if (is_file(__DIR__ . '/' . $route)) { |
|
18 | - if(substr($route, -4) == ".php"){ |
|
19 | - require __DIR__ . '/' . $route; // Include requested script files |
|
16 | + $route = isset($parseUrl['path']) ? $parseUrl['path'] : null; |
|
17 | + if (is_file(__DIR__.'/'.$route)) { |
|
18 | + if (substr($route, -4) == ".php") { |
|
19 | + require __DIR__.'/'.$route; // Include requested script files |
|
20 | 20 | exit; |
21 | 21 | } |
22 | - return false; // Serve file as is |
|
22 | + return false; // Serve file as is |
|
23 | 23 | } else { // Fallback to index.php |
24 | - $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
24 | + $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | } else { |
42 | 42 | echo '<p>Could not initialize autoloading. This happens, if the dependencies are not installed yet.</p>'; |
43 | 43 | echo '<p>Please try to install the dependencies via: </p>'; |
44 | - echo '<code>cd '. realpath('.') .'<br>./install.sh</code>'; |
|
45 | - echo '<p>exit at ' . __FILE__ . ' in line ' . __LINE__ .'</p>'; |
|
44 | + echo '<code>cd '.realpath('.').'<br>./install.sh</code>'; |
|
45 | + echo '<p>exit at '.__FILE__.' in line '.__LINE__.'</p>'; |
|
46 | 46 | exit; |
47 | 47 | } |
48 | 48 |
@@ -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 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function setHouseNumber($houseNumber = "") |
88 | 88 | { |
89 | - $this->houseNumber=$houseNumber; |
|
89 | + $this->houseNumber = $houseNumber; |
|
90 | 90 | return $this; |
91 | 91 | } |
92 | 92 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function setStreet($street = "") |
154 | 154 | { |
155 | - $this->street=$street; |
|
155 | + $this->street = $street; |
|
156 | 156 | return $this; |
157 | 157 | } |
158 | 158 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function setCountry($country = "") |
176 | 176 | { |
177 | - $this->country=$country; |
|
177 | + $this->country = $country; |
|
178 | 178 | return $this; |
179 | 179 | } |
180 | 180 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | */ |
200 | 200 | public function setPhone($phone = "") |
201 | 201 | { |
202 | - $this->phone=$phone; |
|
202 | + $this->phone = $phone; |
|
203 | 203 | return $this; |
204 | 204 | } |
205 | 205 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function setFax($fax = "") |
224 | 224 | { |
225 | - $this->fax=$fax; |
|
225 | + $this->fax = $fax; |
|
226 | 226 | return $this; |
227 | 227 | } |
228 | 228 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function __invoke(Job $jobEntity, $options = [], $urlParams = []) |
69 | 69 | { |
70 | 70 | |
71 | - $options= array_merge($this->options, $options); |
|
71 | + $options = array_merge($this->options, $options); |
|
72 | 72 | $paramsHelper = $this->paramsHelper; |
73 | 73 | $urlHelper = $this->urlHelper; |
74 | 74 | $serverUrlHelper = $this->serverUrlHelper; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!empty($jobEntity->getLink())) { |
78 | 78 | $url = $jobEntity->getLink(); |
79 | 79 | $isExternalLink = true; |
80 | - }elseif($options['showPendingJobs']) { |
|
80 | + }elseif ($options['showPendingJobs']) { |
|
81 | 81 | $url = $urlHelper( |
82 | 82 | 'lang/jobs/approval', |
83 | 83 | [], |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | ] |
88 | 88 | ], true); |
89 | 89 | |
90 | - }else{ |
|
90 | + } else { |
|
91 | 91 | |
92 | 92 | $query = [ |
93 | - 'subscriberUri' => $serverUrlHelper([]) . '/subscriber/' . 1, |
|
93 | + 'subscriberUri' => $serverUrlHelper([]).'/subscriber/'.1, |
|
94 | 94 | 'id' => $jobEntity->getId() |
95 | 95 | ]; |
96 | 96 | if ($jobEntity instanceOf JobSnapshot) { |
@@ -107,16 +107,16 @@ discard block |
||
107 | 107 | $url = $urlHelper($route, $params, array('query' => $query)); |
108 | 108 | } |
109 | 109 | |
110 | - if ($options['linkOnly']){ |
|
110 | + if ($options['linkOnly']) { |
|
111 | 111 | $result = $url; |
112 | - if ($options['absolute'] && !$isExternalLink){ |
|
112 | + if ($options['absolute'] && !$isExternalLink) { |
|
113 | 113 | $result = $serverUrlHelper($url); |
114 | 114 | } |
115 | - }else{ |
|
115 | + } else { |
|
116 | 116 | $result = sprintf('<a href="%s" rel="%s" %s>%s</a>', |
117 | 117 | $url, |
118 | 118 | $options['rel'], |
119 | - $options['target']?"target=" . $options['target']:"", |
|
119 | + $options['target'] ? "target=".$options['target'] : "", |
|
120 | 120 | strip_tags($jobEntity->getTitle())); |
121 | 121 | } |
122 | 122 | |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | /** |
127 | 127 | * @param $options |
128 | 128 | */ |
129 | - public function setOptions($options){ |
|
130 | - foreach($options as $key=>$val) { |
|
131 | - if (array_key_exists($this->options,$key)) { |
|
132 | - $this->options[$key]=$val; |
|
129 | + public function setOptions($options) { |
|
130 | + foreach ($options as $key=>$val) { |
|
131 | + if (array_key_exists($this->options, $key)) { |
|
132 | + $this->options[$key] = $val; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | $region = $this->getRegion(); |
67 | 67 | |
68 | 68 | $str = ''; |
69 | - if ($postalCode) { $str .= $postalCode . ' '; } |
|
69 | + if ($postalCode) { $str .= $postalCode.' '; } |
|
70 | 70 | if ($city) { $str .= $city; } |
71 | - if ($region) { $str .= ', ' . $region; } |
|
72 | - if ($country) { $str .= ', ' . $country; } |
|
71 | + if ($region) { $str .= ', '.$region; } |
|
72 | + if ($country) { $str .= ', '.$country; } |
|
73 | 73 | if ($coords) { |
74 | 74 | $coords = $coords->getCoordinates(); |
75 | - $str .= ' ( ' . join(', ', $coords) . ' )'; |
|
75 | + $str .= ' ( '.join(', ', $coords).' )'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | return $str; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | if (!$value) { continue; } |
108 | 108 | |
109 | 109 | if ('coordinates' == $key) { |
110 | - $class = '\\Geo\\Entity\\Geometry\\' . $value['type']; |
|
110 | + $class = '\\Geo\\Entity\\Geometry\\'.$value['type']; |
|
111 | 111 | $value = new $class($value['coordinates']); |
112 | 112 | } |
113 | 113 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | public function __construct(EntityInterface $source) |
34 | 34 | { |
35 | 35 | $this->snapshotMeta = new SnapshotMeta(); |
36 | - $this->snapshotEntity = $source; |
|
36 | + $this->snapshotEntity = $source; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function getOriginalEntity() |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | protected function save() |
227 | 227 | { |
228 | 228 | $formEvents = $this->jobFormEvents; |
229 | - $user = $this->auth->getUser(); |
|
229 | + $user = $this->auth->getUser(); |
|
230 | 230 | if (empty($user->getInfo()->getEmail())) { |
231 | 231 | return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail')); |
232 | 232 | } |
233 | - $userOrg = $user->getOrganization(); |
|
233 | + $userOrg = $user->getOrganization(); |
|
234 | 234 | if (!$userOrg->hasAssociation() || $userOrg->getOrganization()->isDraft()) { |
235 | 235 | return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany')); |
236 | 236 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | |
263 | - $viewModel = null; |
|
263 | + $viewModel = null; |
|
264 | 264 | $this->acl($jobEntity, 'edit'); |
265 | 265 | if ($status = $params->fromQuery('status')) { |
266 | 266 | $this->changeStatus($jobEntity, $status); |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | $instanceForm = null; |
273 | 273 | $formErrorMessages = array(); |
274 | 274 | |
275 | - if (isset($formIdentifier) && $request->isPost()) { |
|
275 | + if (isset($formIdentifier) && $request->isPost()) { |
|
276 | 276 | // at this point the form get instantiated and immediately accumulated |
277 | 277 | $instanceForm = $form->getForm($formIdentifier); |
278 | 278 | if (!isset($instanceForm)) { |
279 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
279 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
280 | 280 | } |
281 | 281 | // the id may be part of the postData, but it never should be altered |
282 | 282 | $postData = $request->getPost(); |
@@ -330,20 +330,20 @@ discard block |
||
330 | 330 | $jobValid = false; |
331 | 331 | $errorMessage[] = $this->translator->translate('Accept the Terms'); |
332 | 332 | } |
333 | - $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]); |
|
333 | + $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]); |
|
334 | 334 | foreach ($result as $messages) { |
335 | 335 | if (!$messages) { |
336 | 336 | continue; |
337 | 337 | } |
338 | 338 | if (!is_array($messages)) { |
339 | - $messages = [ $messages ]; |
|
339 | + $messages = [$messages]; |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | $errorMessage = array_merge($errorMessage, $messages); |
343 | 343 | $jobValid = false; |
344 | 344 | } |
345 | 345 | |
346 | - $errorMessage = '<br />' . implode('<br />', $errorMessage); |
|
346 | + $errorMessage = '<br />'.implode('<br />', $errorMessage); |
|
347 | 347 | if ($isAjax) { |
348 | 348 | if ($instanceForm instanceof SummaryForm) { |
349 | 349 | $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } else { |
352 | 352 | $viewHelper = 'form'; |
353 | 353 | } |
354 | - $viewHelperManager = $this->viewHelper; |
|
354 | + $viewHelperManager = $this->viewHelper; |
|
355 | 355 | $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm); |
356 | 356 | $viewModel = new JsonModel( |
357 | 357 | array( |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | } |
376 | 376 | } |
377 | 377 | } else { |
378 | - $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]); |
|
378 | + $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]); |
|
379 | 379 | // Job is deployed, some changes are now disabled |
380 | 380 | $form->enableAll(); |
381 | 381 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | $completionLink = $this->url()->fromRoute( |
385 | 385 | 'lang/jobs/completion', |
386 | - [ 'id' => $jobEntity->getId()] |
|
386 | + ['id' => $jobEntity->getId()] |
|
387 | 387 | ); |
388 | 388 | |
389 | 389 | $viewModel = $this->getViewModel($form); |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | protected function getFormular($job) |
450 | 450 | { |
451 | 451 | /* @var $forms \Zend\Form\FormElementManager\FormElementManagerV3Polyfill */ |
452 | - $forms = $this->formManager; |
|
452 | + $forms = $this->formManager; |
|
453 | 453 | /* @var $container \Jobs\Form\Job */ |
454 | 454 | |
455 | 455 | $container = $forms->get( |
@@ -554,11 +554,11 @@ discard block |
||
554 | 554 | // array with differences between the last snapshot and the actual entity |
555 | 555 | // is remains Null if there is no snapshot |
556 | 556 | // it will be an empty array if the snapshot and the actual entity do not differ |
557 | - $diff = null; |
|
557 | + $diff = null; |
|
558 | 558 | |
559 | 559 | |
560 | 560 | if ($params == 'declined') { |
561 | - if ($jobEntity instanceOf JobSnapshot) { |
|
561 | + if ($jobEntity instanceOf JobSnapshot) { |
|
562 | 562 | $jobEntity->getOriginalEntity()->changeStatus(Status::ACTIVE, sprintf(/*@translate*/ 'Changes were rejected by %s', $user->getDisplayName())); |
563 | 563 | } else { |
564 | 564 | $jobEntity->changeStatus( |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | */ |
624 | 624 | public function deactivateAction() |
625 | 625 | { |
626 | - $user = $this->auth->getUser(); |
|
626 | + $user = $this->auth->getUser(); |
|
627 | 627 | |
628 | 628 | $jobEntity = $this->initializeJob()->get($this->params()); |
629 | 629 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function getApplication() |
45 | 45 | { |
46 | - if(!is_object(static::$application)){ |
|
46 | + if (!is_object(static::$application)) { |
|
47 | 47 | $configFile = realpath(__DIR__.'/../../../config/config.php'); |
48 | 48 | $config = include($configFile); |
49 | 49 | static::$application = Application::init($config); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | public function iSubmitTheFormWithId($arg) |
128 | 128 | { |
129 | 129 | $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
130 | - if($node) { |
|
130 | + if ($node) { |
|
131 | 131 | $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
132 | 132 | } else { |
133 | 133 | throw new \Exception('Element not found'); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | public function iSetMainWindowName() |
152 | 152 | { |
153 | 153 | $window_name = 'main_window'; |
154 | - $script = 'window.name = "' . $window_name . '"'; |
|
154 | + $script = 'window.name = "'.$window_name.'"'; |
|
155 | 155 | $this->getSession()->executeScript($script); |
156 | 156 | } |
157 | 157 | |
@@ -210,14 +210,14 @@ discard block |
||
210 | 210 | break; |
211 | 211 | |
212 | 212 | default: |
213 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
213 | + throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath'); |
|
214 | 214 | break; |
215 | 215 | } |
216 | 216 | |
217 | 217 | try { |
218 | 218 | $this->getSession()->executeScript($function); |
219 | 219 | } catch (\Exception $e) { |
220 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
220 | + throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"'); |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | * |
239 | 239 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
240 | 240 | */ |
241 | - public function getElement($locator,$selector='css') |
|
241 | + public function getElement($locator, $selector = 'css') |
|
242 | 242 | { |
243 | 243 | $page = $this->minkContext->getSession()->getPage(); |
244 | - $element = $page->find('css',$locator); |
|
244 | + $element = $page->find('css', $locator); |
|
245 | 245 | return $element; |
246 | 246 | } |
247 | 247 |
@@ -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 = '#general-classifications-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 |