@@ -191,9 +191,9 @@ |
||
191 | 191 | $location = new Location(); |
192 | 192 | $coords = array_map(function ($i) { return (float) $i; }, $locData['coordinates']); |
193 | 193 | $location->setCountry($locData['country']) |
194 | - ->setRegion($locData['region']) |
|
195 | - ->setCity($locData['city']) |
|
196 | - ->setCoordinates(new Point($coords)); |
|
194 | + ->setRegion($locData['region']) |
|
195 | + ->setCity($locData['city']) |
|
196 | + ->setCoordinates(new Point($coords)); |
|
197 | 197 | |
198 | 198 | $jobLocations->add($location); |
199 | 199 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $entity = $repositoriesJob->findOneBy(array("applyId" => (string) $applyId)); |
85 | 85 | if (!isset($entity)) { |
86 | 86 | // new Job (the more likely branch) |
87 | - $entity =$repositoriesJob->create(array("applyId" => (string) $applyId)); |
|
87 | + $entity = $repositoriesJob->create(array("applyId" => (string) $applyId)); |
|
88 | 88 | } else { |
89 | 89 | $createdJob = false; |
90 | 90 | } |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | $entity->getPermissions()->grant($group, PermissionsInterface::PERMISSION_VIEW); |
131 | 131 | } |
132 | 132 | $result['isSaved'] = true; |
133 | - $log->info('Jobs/manage/saveJob [user: ' . $user->getLogin() . ']:' . var_export($p, true)); |
|
133 | + $log->info('Jobs/manage/saveJob [user: '.$user->getLogin().']:'.var_export($p, true)); |
|
134 | 134 | |
135 | 135 | if (!empty($params->companyId)) { |
136 | - $companyId = $params->companyId . $loginSuffix; |
|
136 | + $companyId = $params->companyId.$loginSuffix; |
|
137 | 137 | $repOrganization = $repositories->get('Organizations/Organization'); |
138 | 138 | $hydratorManager = $services->get('HydratorManager'); |
139 | 139 | /* @var \Organizations\Entity\Hydrator\OrganizationHydrator $hydrator */ |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $jobLocations->clear(); |
190 | 190 | foreach ($locations as $locData) { |
191 | 191 | $location = new Location(); |
192 | - $coords = array_map(function ($i) { return (float) $i; }, $locData['coordinates']); |
|
192 | + $coords = array_map(function($i) { return (float) $i; }, $locData['coordinates']); |
|
193 | 193 | $location->setCountry($locData['country']) |
194 | 194 | ->setRegion($locData['region']) |
195 | 195 | ->setCity($locData['city']) |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | break; |
255 | 255 | } |
256 | 256 | if (array_key_exists($portal, $result['portals'])) { |
257 | - throw new \RuntimeException('Publisher-Events (internal error): There are two publisher registered for ' . $portal); |
|
257 | + throw new \RuntimeException('Publisher-Events (internal error): There are two publisher registered for '.$portal); |
|
258 | 258 | } |
259 | 259 | $result['portals'][$portal] = $status; |
260 | 260 | } else { |
@@ -267,16 +267,16 @@ discard block |
||
267 | 267 | } |
268 | 268 | } |
269 | 269 | } else { |
270 | - $log->info('Jobs/manage/saveJob [error: ' . $form->getMessages() . ']:' . var_export($p, true)); |
|
270 | + $log->info('Jobs/manage/saveJob [error: '.$form->getMessages().']:'.var_export($p, true)); |
|
271 | 271 | $result['valid Error'] = $form->getMessages(); |
272 | 272 | } |
273 | 273 | } |
274 | 274 | } else { |
275 | - $log->info('Jobs/manage/saveJob [error: session lost]:' . var_export($p, true)); |
|
275 | + $log->info('Jobs/manage/saveJob [error: session lost]:'.var_export($p, true)); |
|
276 | 276 | $result['message'] = 'session_id is lost'; |
277 | 277 | } |
278 | 278 | } catch (\Exception $e) { |
279 | - $result['message'] = 'exception occured: ' . $e->getMessage(); |
|
279 | + $result['message'] = 'exception occured: '.$e->getMessage(); |
|
280 | 280 | } |
281 | 281 | //$services->get('Core/Log')->info('Jobs/manage/saveJob result:' . PHP_EOL . var_export($p, True)); |
282 | 282 | return new JsonModel($result); |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | * Event is fired when a users has created a new job opening and accepted the |
34 | 34 | * terms and conditions |
35 | 35 | */ |
36 | - const EVENT_JOB_CREATED = 'job.created'; |
|
36 | + const EVENT_JOB_CREATED = 'job.created'; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Event is fired when the owner of the YAWIK installation has accepted the job |
40 | 40 | * opening |
41 | 41 | */ |
42 | - const EVENT_JOB_ACCEPTED = 'job.accepted'; |
|
42 | + const EVENT_JOB_ACCEPTED = 'job.accepted'; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Event is fired, when the owner of the YAWIK installation has rejected the job |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * get all available names for publishing |
57 | 57 | */ |
58 | - const PORTAL_AVAIL_NAME = 'portal.availname'; |
|
58 | + const PORTAL_AVAIL_NAME = 'portal.availname'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * portals to be published |
@@ -39,24 +39,24 @@ discard block |
||
39 | 39 | 'log' => array( |
40 | 40 | 'Core/Log' => array( |
41 | 41 | 'writers' => array( |
42 | - array( |
|
43 | - 'name' => 'stream', |
|
42 | + array( |
|
43 | + 'name' => 'stream', |
|
44 | 44 | 'priority' => 1000, |
45 | 45 | 'options' => array( |
46 | - 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
46 | + 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
47 | + ), |
|
47 | 48 | ), |
48 | - ), |
|
49 | 49 | ), |
50 | 50 | ), |
51 | 51 | 'Log/Core/Mail' => array( |
52 | 52 | 'writers' => array( |
53 | - array( |
|
54 | - 'name' => 'stream', |
|
53 | + array( |
|
54 | + 'name' => 'stream', |
|
55 | 55 | 'priority' => 1000, |
56 | 56 | 'options' => array( |
57 | - 'stream' => __DIR__ .'/../../../log/mails.log', |
|
57 | + 'stream' => __DIR__ .'/../../../log/mails.log', |
|
58 | + ), |
|
58 | 59 | ), |
59 | - ), |
|
60 | 60 | ), |
61 | 61 | ), |
62 | 62 | ), |
@@ -248,17 +248,17 @@ discard block |
||
248 | 248 | // Defines the Core/Navigation. |
249 | 249 | 'navigation' => array( |
250 | 250 | 'default' => array( |
251 | - 'home' => array( |
|
252 | - 'label' => /*@translate*/ 'Home', |
|
253 | - 'route' => 'lang', |
|
254 | - 'visible' => false |
|
255 | - ), |
|
256 | - 'admin' => array( |
|
257 | - 'label ' => /*@translate*/ 'Admin', |
|
258 | - 'route' => 'lang/admin', |
|
259 | - 'resource' => 'route/lang/admin', |
|
260 | - 'order' => 200, |
|
261 | - ), |
|
251 | + 'home' => array( |
|
252 | + 'label' => /*@translate*/ 'Home', |
|
253 | + 'route' => 'lang', |
|
254 | + 'visible' => false |
|
255 | + ), |
|
256 | + 'admin' => array( |
|
257 | + 'label ' => /*@translate*/ 'Admin', |
|
258 | + 'route' => 'lang/admin', |
|
259 | + 'resource' => 'route/lang/admin', |
|
260 | + 'order' => 200, |
|
261 | + ), |
|
262 | 262 | ), |
263 | 263 | ), |
264 | 264 | // Configuration of the controller service manager (Which loads controllers) |
@@ -266,14 +266,14 @@ discard block |
||
266 | 266 | 'invokables' => array( |
267 | 267 | 'Core\Controller\Content' => 'Core\Controller\ContentController', |
268 | 268 | ), |
269 | - 'factories' => [ |
|
270 | - // @TODO: improve this factory |
|
271 | - 'Core\Controller\Index' => [\Core\Controller\IndexController::class,'factory'], |
|
272 | - 'Core/Admin' => [\Core\Controller\AdminController::class,'factory'], |
|
273 | - 'Core\Controller\File' => [\Core\Controller\FileController::class,'factory'], |
|
274 | - ], |
|
269 | + 'factories' => [ |
|
270 | + // @TODO: improve this factory |
|
271 | + 'Core\Controller\Index' => [\Core\Controller\IndexController::class,'factory'], |
|
272 | + 'Core/Admin' => [\Core\Controller\AdminController::class,'factory'], |
|
273 | + 'Core\Controller\File' => [\Core\Controller\FileController::class,'factory'], |
|
274 | + ], |
|
275 | 275 | 'abstract_factories' => [ |
276 | - \Core\Factory\Controller\LazyControllerFactory::class |
|
276 | + \Core\Factory\Controller\LazyControllerFactory::class |
|
277 | 277 | ], |
278 | 278 | ), |
279 | 279 | // Configuration of the controller plugin service manager |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | 'paginatorservice' => 'Core/PaginatorService', |
305 | 305 | 'paginationParams' => 'Core/PaginationParams', |
306 | 306 | 'searchform' => 'Core/SearchForm', |
307 | - 'notification' => 'Notification', |
|
307 | + 'notification' => 'Notification', |
|
308 | 308 | ) |
309 | 309 | ), |
310 | 310 | // Configure the view service manager |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | ), |
403 | 403 | 'aliases' => [ |
404 | 404 | 'snippet' => \Core\View\Helper\Snippet::class, |
405 | - 'ajaxUrl' => \Core\View\Helper\AjaxUrl::class, |
|
405 | + 'ajaxUrl' => \Core\View\Helper\AjaxUrl::class, |
|
406 | 406 | 'proxy' => \Core\View\Helper\Proxy::class, |
407 | 407 | 'form_element' => 'formElement', |
408 | 408 | ], |
@@ -500,17 +500,17 @@ discard block |
||
500 | 500 | ], |
501 | 501 | |
502 | 502 | 'Core/Ajax/Events' => [ |
503 | - 'service' => 'Core/EventManager', |
|
504 | - 'event' => \Core\Listener\Events\AjaxEvent::class, |
|
503 | + 'service' => 'Core/EventManager', |
|
504 | + 'event' => \Core\Listener\Events\AjaxEvent::class, |
|
505 | 505 | ], |
506 | 506 | |
507 | - 'Core/File/Events' => [ |
|
508 | - 'service' => 'Core/EventManager', |
|
509 | - 'event' => \Core\Listener\Events\FileEvent::class, |
|
507 | + 'Core/File/Events' => [ |
|
508 | + 'service' => 'Core/EventManager', |
|
509 | + 'event' => \Core\Listener\Events\FileEvent::class, |
|
510 | 510 | 'listeners' => [ |
511 | 511 | \Core\Listener\DeleteImageSetListener::class => [\Core\Listener\Events\FileEvent::EVENT_DELETE, -1000], |
512 | 512 | ], |
513 | - ] |
|
513 | + ] |
|
514 | 514 | ], |
515 | 515 | |
516 | 516 | ); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | use Zend\I18n\Translator\Resources; |
17 | 17 | use Zend\ServiceManager\Factory\InvokableFactory; |
18 | 18 | |
19 | -$doctrineConfig = include __DIR__ . '/doctrine.config.php'; |
|
19 | +$doctrineConfig = include __DIR__.'/doctrine.config.php'; |
|
20 | 20 | |
21 | 21 | |
22 | 22 | return array( |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | 'doctrine' => $doctrineConfig, |
25 | 25 | |
26 | 26 | 'options' => [ |
27 | - 'Core/MailServiceOptions' => [ 'class' => '\Core\Options\MailServiceOptions' ], |
|
27 | + 'Core/MailServiceOptions' => ['class' => '\Core\Options\MailServiceOptions'], |
|
28 | 28 | ], |
29 | 29 | |
30 | 30 | 'Core' => array( |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | 'name' => 'stream', |
45 | 45 | 'priority' => 1000, |
46 | 46 | 'options' => array( |
47 | - 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
47 | + 'stream' => __DIR__.'/../../../log/yawik.log', |
|
48 | 48 | ), |
49 | 49 | ), |
50 | 50 | ), |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'name' => 'stream', |
56 | 56 | 'priority' => 1000, |
57 | 57 | 'options' => array( |
58 | - 'stream' => __DIR__ .'/../../../log/mails.log', |
|
58 | + 'stream' => __DIR__.'/../../../log/mails.log', |
|
59 | 59 | ), |
60 | 60 | ), |
61 | 61 | ), |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array |
73 | 73 | 'bar' => false, // bool = enabled|Toggle nette diagnostics bar. |
74 | 74 | 'strict' => true, // bool = cause immediate death|int = matched against error severity |
75 | - 'log' => __DIR__ . '/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
75 | + 'log' => __DIR__.'/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
76 | 76 | 'email' => null, // in production mode notifies the recipient |
77 | 77 | 'email_snooze' => 900 // interval for sending email in seconds |
78 | 78 | ], |
@@ -199,16 +199,16 @@ discard block |
||
199 | 199 | 'Core/JsonEntityHydrator' => 'Core\Entity\Hydrator\JsonEntityHydratorFactory', |
200 | 200 | 'Core/EntityHydrator' => 'Core\Entity\Hydrator\EntityHydratorFactory', |
201 | 201 | 'Core/Options' => 'Core\Factory\ModuleOptionsFactory', |
202 | - 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class,'factory'], |
|
203 | - 'DefaultListeners' => ['Core\Listener\DefaultListener','factory'], |
|
204 | - 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy','factory'], |
|
205 | - 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class,'factory'], |
|
202 | + 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class, 'factory'], |
|
203 | + 'DefaultListeners' => ['Core\Listener\DefaultListener', 'factory'], |
|
204 | + 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy', 'factory'], |
|
205 | + 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class, 'factory'], |
|
206 | 206 | 'Core/Listener/CreatePaginator' => 'Core\Listener\CreatePaginatorListener::factory', |
207 | 207 | 'Core/Locale' => 'Core\I18n\LocaleFactory', |
208 | 208 | \Core\Listener\AjaxRouteListener::class => \Core\Factory\Listener\AjaxRouteListenerFactory::class, |
209 | 209 | \Core\Listener\DeleteImageSetListener::class => \Core\Factory\Listener\DeleteImageSetListenerFactory::class, |
210 | 210 | 'Imagine' => \Core\Factory\Service\ImagineFactory::class, |
211 | - 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class,'factory'], |
|
211 | + 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class, 'factory'], |
|
212 | 212 | ), |
213 | 213 | 'abstract_factories' => array( |
214 | 214 | 'Core\Factory\OptionsAbstractFactory', |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | 'translation_file_patterns' => array( |
232 | 232 | [ |
233 | 233 | 'type' => 'gettext', |
234 | - 'base_dir' => __DIR__ . '/../language', |
|
234 | + 'base_dir' => __DIR__.'/../language', |
|
235 | 235 | 'pattern' => '%s.mo', |
236 | 236 | ], |
237 | 237 | [ |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | ), |
270 | 270 | 'factories' => [ |
271 | 271 | // @TODO: improve this factory |
272 | - 'Core\Controller\Index' => [\Core\Controller\IndexController::class,'factory'], |
|
273 | - 'Core/Admin' => [\Core\Controller\AdminController::class,'factory'], |
|
274 | - 'Core\Controller\File' => [\Core\Controller\FileController::class,'factory'], |
|
272 | + 'Core\Controller\Index' => [\Core\Controller\IndexController::class, 'factory'], |
|
273 | + 'Core/Admin' => [\Core\Controller\AdminController::class, 'factory'], |
|
274 | + 'Core\Controller\File' => [\Core\Controller\FileController::class, 'factory'], |
|
275 | 275 | ], |
276 | 276 | 'abstract_factories' => [ |
277 | 277 | \Core\Factory\Controller\LazyControllerFactory::class |
@@ -286,9 +286,9 @@ discard block |
||
286 | 286 | 'Core/SearchForm' => 'Core\Factory\Controller\Plugin\SearchFormFactory', |
287 | 287 | 'listquery' => 'Core\Controller\Plugin\ListQuery::factory', |
288 | 288 | 'mail' => 'Core\Controller\Plugin\Mail::factory', |
289 | - 'Core/Mailer' => ['Core\Controller\Plugin\Mailer','factory'], |
|
290 | - 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class,'factory'], |
|
291 | - 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class,'factory'], |
|
289 | + 'Core/Mailer' => ['Core\Controller\Plugin\Mailer', 'factory'], |
|
290 | + 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class, 'factory'], |
|
291 | + 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class, 'factory'], |
|
292 | 292 | ), |
293 | 293 | 'invokables' => array( |
294 | 294 | 'Core/FileSender' => 'Core\Controller\Plugin\FileSender', |
@@ -318,32 +318,32 @@ discard block |
||
318 | 318 | 'exception_template' => 'error/index', |
319 | 319 | // Map template to files. Speeds up the lookup through the template stack. |
320 | 320 | 'template_map' => array( |
321 | - 'noscript-notice' => __DIR__ . '/../view/layout/_noscript-notice.phtml', |
|
322 | - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
|
323 | - 'error/404' => __DIR__ . '/../view/error/404.phtml', |
|
324 | - 'error/403' => __DIR__ . '/../view/error/403.phtml', |
|
325 | - 'error/index' => __DIR__ . '/../view/error/index.phtml', |
|
326 | - 'main-navigation' => __DIR__ . '/../view/partial/main-navigation.phtml', |
|
327 | - 'pagination-control' => __DIR__ . '/../view/partial/pagination-control.phtml', |
|
328 | - 'core/loading-popup' => __DIR__ . '/../view/partial/loading-popup.phtml', |
|
329 | - 'core/notifications' => __DIR__ . '/../view/partial/notifications.phtml', |
|
330 | - 'form/core/buttons' => __DIR__ . '/../view/form/buttons.phtml', |
|
331 | - 'core/social-buttons' => __DIR__ . '/../view/partial/social-buttons.phtml', |
|
332 | - 'form/core/privacy' => __DIR__ . '/../view/form/privacy.phtml', |
|
333 | - 'core/form/permissions-fieldset' => __DIR__ . '/../view/form/permissions-fieldset.phtml', |
|
334 | - 'core/form/permissions-collection' => __DIR__ . '/../view/form/permissions-collection.phtml', |
|
335 | - 'core/form/container-view' => __DIR__ . '/../view/form/container.view.phtml', |
|
336 | - 'core/form/tree-manage.view' => __DIR__ . '/../view/form/tree-manage.view.phtml', |
|
337 | - 'core/form/tree-manage.form' => __DIR__ . '/../view/form/tree-manage.form.phtml', |
|
338 | - 'core/form/tree-add-item' => __DIR__ . '/../view/form/tree-add-item.phtml', |
|
339 | - 'mail/header' => __DIR__ . '/../view/mail/header.phtml', |
|
340 | - 'mail/footer' => __DIR__ . '/../view/mail/footer.phtml', |
|
341 | - 'mail/footer.en' => __DIR__ . '/../view/mail/footer.en.phtml', |
|
321 | + 'noscript-notice' => __DIR__.'/../view/layout/_noscript-notice.phtml', |
|
322 | + 'layout/layout' => __DIR__.'/../view/layout/layout.phtml', |
|
323 | + 'error/404' => __DIR__.'/../view/error/404.phtml', |
|
324 | + 'error/403' => __DIR__.'/../view/error/403.phtml', |
|
325 | + 'error/index' => __DIR__.'/../view/error/index.phtml', |
|
326 | + 'main-navigation' => __DIR__.'/../view/partial/main-navigation.phtml', |
|
327 | + 'pagination-control' => __DIR__.'/../view/partial/pagination-control.phtml', |
|
328 | + 'core/loading-popup' => __DIR__.'/../view/partial/loading-popup.phtml', |
|
329 | + 'core/notifications' => __DIR__.'/../view/partial/notifications.phtml', |
|
330 | + 'form/core/buttons' => __DIR__.'/../view/form/buttons.phtml', |
|
331 | + 'core/social-buttons' => __DIR__.'/../view/partial/social-buttons.phtml', |
|
332 | + 'form/core/privacy' => __DIR__.'/../view/form/privacy.phtml', |
|
333 | + 'core/form/permissions-fieldset' => __DIR__.'/../view/form/permissions-fieldset.phtml', |
|
334 | + 'core/form/permissions-collection' => __DIR__.'/../view/form/permissions-collection.phtml', |
|
335 | + 'core/form/container-view' => __DIR__.'/../view/form/container.view.phtml', |
|
336 | + 'core/form/tree-manage.view' => __DIR__.'/../view/form/tree-manage.view.phtml', |
|
337 | + 'core/form/tree-manage.form' => __DIR__.'/../view/form/tree-manage.form.phtml', |
|
338 | + 'core/form/tree-add-item' => __DIR__.'/../view/form/tree-add-item.phtml', |
|
339 | + 'mail/header' => __DIR__.'/../view/mail/header.phtml', |
|
340 | + 'mail/footer' => __DIR__.'/../view/mail/footer.phtml', |
|
341 | + 'mail/footer.en' => __DIR__.'/../view/mail/footer.en.phtml', |
|
342 | 342 | //'startpage' => __DIR__ . '/../view/layout/startpage.phtml', |
343 | 343 | ), |
344 | 344 | // Where to look for view templates not mapped above |
345 | 345 | 'template_path_stack' => array( |
346 | - __DIR__ . '/../view', |
|
346 | + __DIR__.'/../view', |
|
347 | 347 | ), |
348 | 348 | ), |
349 | 349 | 'view_helpers' => array( |
@@ -69,6 +69,9 @@ |
||
69 | 69 | */ |
70 | 70 | protected $parent; |
71 | 71 | |
72 | + /** |
|
73 | + * @param string $value |
|
74 | + */ |
|
72 | 75 | final public static function filterValue($value) |
73 | 76 | { |
74 | 77 | $value = mb_strtolower($value); |
@@ -153,7 +153,7 @@ |
||
153 | 153 | |
154 | 154 | public function getValueWithParents($withRoot = false, $useNames = false) |
155 | 155 | { |
156 | - $parts = [ ($useNames ? $this->getName() : $this->getValue()) ]; |
|
156 | + $parts = [($useNames ? $this->getName() : $this->getValue())]; |
|
157 | 157 | $item = $this; |
158 | 158 | |
159 | 159 | while ($item = $item->getParent()) { |
@@ -20,8 +20,8 @@ |
||
20 | 20 | * @ODM\HasLifecycleCallbacks |
21 | 21 | */ |
22 | 22 | class SnapshotMeta implements ModificationDateAwareEntityInterface, |
23 | - DraftableEntityInterface, |
|
24 | - Status\StatusAwareEntityInterface |
|
23 | + DraftableEntityInterface, |
|
24 | + Status\StatusAwareEntityInterface |
|
25 | 25 | { |
26 | 26 | use ModificationDateAwareEntityTrait, DraftableEntityTrait, Status\StatusAwareEntityTrait; |
27 | 27 | } |
@@ -9,19 +9,19 @@ |
||
9 | 9 | |
10 | 10 | class LanguageSkillCollectionFactory implements FactoryInterface |
11 | 11 | { |
12 | - /** |
|
13 | - * Create a CollectionContainer form |
|
14 | - * |
|
15 | - * @param ContainerInterface $container |
|
16 | - * @param string $requestedName |
|
17 | - * @param array|null $options |
|
18 | - * |
|
19 | - * @return \Core\Form\CollectionContainer |
|
20 | - */ |
|
12 | + /** |
|
13 | + * Create a CollectionContainer form |
|
14 | + * |
|
15 | + * @param ContainerInterface $container |
|
16 | + * @param string $requestedName |
|
17 | + * @param array|null $options |
|
18 | + * |
|
19 | + * @return \Core\Form\CollectionContainer |
|
20 | + */ |
|
21 | 21 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { |
22 | - $collectionContainer = new CollectionContainer( 'Cv/LanguageSkillForm', new Language() ); |
|
23 | - $collectionContainer->setLabel(/*@translate */ 'Additional Language Skills' ); |
|
22 | + $collectionContainer = new CollectionContainer( 'Cv/LanguageSkillForm', new Language() ); |
|
23 | + $collectionContainer->setLabel(/*@translate */ 'Additional Language Skills' ); |
|
24 | 24 | |
25 | - return $collectionContainer; |
|
25 | + return $collectionContainer; |
|
26 | 26 | } |
27 | 27 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * @return \Core\Form\CollectionContainer |
20 | 20 | */ |
21 | 21 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { |
22 | - $collectionContainer = new CollectionContainer( 'Cv/LanguageSkillForm', new Language() ); |
|
22 | + $collectionContainer = new CollectionContainer('Cv/LanguageSkillForm', new Language()); |
|
23 | 23 | $collectionContainer->setLabel(/*@translate */ 'Additional Language Skills' ); |
24 | 24 | |
25 | 25 | return $collectionContainer; |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | public function gatherContexts(BeforeScenarioScope $scope) |
40 | 40 | { |
41 | 41 | $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
42 | - if(false === static::$jobCategoryChecked){ |
|
42 | + if (false === static::$jobCategoryChecked) { |
|
43 | 43 | /* @var Categories $catRepo */ |
44 | 44 | $catRepo = $this->getRepositories()->get('Jobs/Category'); |
45 | 45 | $all = $catRepo->findAll(); |
46 | - if(count($all) <= 1){ |
|
46 | + if (count($all) <= 1) { |
|
47 | 47 | $catRepo->createDefaultCategory('professions'); |
48 | 48 | $catRepo->createDefaultCategory('industries'); |
49 | 49 | $catRepo->createDefaultCategory('employmentTypes'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function getApplication() |
59 | 59 | { |
60 | - if(!is_object(static::$application)){ |
|
60 | + if (!is_object(static::$application)) { |
|
61 | 61 | $configFile = realpath(__DIR__.'/../../../config/config.php'); |
62 | 62 | $config = include($configFile); |
63 | 63 | static::$application = Application::init($config); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | public function iSubmitTheFormWithId($arg) |
142 | 142 | { |
143 | 143 | $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
144 | - if($node) { |
|
144 | + if ($node) { |
|
145 | 145 | $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
146 | 146 | } else { |
147 | 147 | throw new \Exception('Element not found'); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function iSetMainWindowName() |
166 | 166 | { |
167 | 167 | $window_name = 'main_window'; |
168 | - $script = 'window.name = "' . $window_name . '"'; |
|
168 | + $script = 'window.name = "'.$window_name.'"'; |
|
169 | 169 | $this->getSession()->executeScript($script); |
170 | 170 | } |
171 | 171 | |
@@ -224,14 +224,14 @@ discard block |
||
224 | 224 | break; |
225 | 225 | |
226 | 226 | default: |
227 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
227 | + throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath'); |
|
228 | 228 | break; |
229 | 229 | } |
230 | 230 | |
231 | 231 | try { |
232 | 232 | $this->getSession()->executeScript($function); |
233 | 233 | } catch (\Exception $e) { |
234 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
234 | + throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"'); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | * |
253 | 253 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
254 | 254 | */ |
255 | - public function getElement($locator,$selector='css') |
|
255 | + public function getElement($locator, $selector = 'css') |
|
256 | 256 | { |
257 | 257 | $page = $this->minkContext->getSession()->getPage(); |
258 | - $element = $page->find('css',$locator); |
|
258 | + $element = $page->find('css', $locator); |
|
259 | 259 | return $element; |
260 | 260 | } |
261 | 261 | |
@@ -287,12 +287,12 @@ discard block |
||
287 | 287 | $session = $this->getSession(); |
288 | 288 | $element = $session->getPage()->find( |
289 | 289 | 'xpath', |
290 | - $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]') |
|
290 | + $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'.$text.'"]') |
|
291 | 291 | ); |
292 | - if(null === $element){ |
|
292 | + if (null === $element) { |
|
293 | 293 | $element = $session->getPage()->find( |
294 | 294 | 'named', |
295 | - array('id',$text) |
|
295 | + array('id', $text) |
|
296 | 296 | ); |
297 | 297 | } |
298 | 298 | if (null === $element) { |
@@ -23,290 +23,290 @@ |
||
23 | 23 | */ |
24 | 24 | class CoreContext extends RawMinkContext |
25 | 25 | { |
26 | - static protected $application; |
|
26 | + static protected $application; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @var MinkContext |
|
30 | - */ |
|
31 | - protected $minkContext; |
|
28 | + /** |
|
29 | + * @var MinkContext |
|
30 | + */ |
|
31 | + protected $minkContext; |
|
32 | 32 | |
33 | - static private $jobCategoryChecked = false; |
|
33 | + static private $jobCategoryChecked = false; |
|
34 | 34 | |
35 | - /** |
|
36 | - * @BeforeScenario |
|
37 | - * @param BeforeScenarioScope $scope |
|
38 | - */ |
|
39 | - public function gatherContexts(BeforeScenarioScope $scope) |
|
40 | - { |
|
41 | - $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
42 | - if(false === static::$jobCategoryChecked){ |
|
43 | - /* @var Categories $catRepo */ |
|
44 | - $catRepo = $this->getRepositories()->get('Jobs/Category'); |
|
45 | - $all = $catRepo->findAll(); |
|
46 | - if(count($all) <= 1){ |
|
47 | - $catRepo->createDefaultCategory('professions'); |
|
48 | - $catRepo->createDefaultCategory('industries'); |
|
49 | - $catRepo->createDefaultCategory('employmentTypes'); |
|
50 | - } |
|
51 | - static::$jobCategoryChecked = true; |
|
52 | - } |
|
53 | - } |
|
35 | + /** |
|
36 | + * @BeforeScenario |
|
37 | + * @param BeforeScenarioScope $scope |
|
38 | + */ |
|
39 | + public function gatherContexts(BeforeScenarioScope $scope) |
|
40 | + { |
|
41 | + $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
42 | + if(false === static::$jobCategoryChecked){ |
|
43 | + /* @var Categories $catRepo */ |
|
44 | + $catRepo = $this->getRepositories()->get('Jobs/Category'); |
|
45 | + $all = $catRepo->findAll(); |
|
46 | + if(count($all) <= 1){ |
|
47 | + $catRepo->createDefaultCategory('professions'); |
|
48 | + $catRepo->createDefaultCategory('industries'); |
|
49 | + $catRepo->createDefaultCategory('employmentTypes'); |
|
50 | + } |
|
51 | + static::$jobCategoryChecked = true; |
|
52 | + } |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @return Application |
|
57 | - */ |
|
58 | - public function getApplication() |
|
59 | - { |
|
60 | - if(!is_object(static::$application)){ |
|
61 | - $configFile = realpath(__DIR__.'/../../../config/config.php'); |
|
62 | - $config = include($configFile); |
|
63 | - static::$application = Application::init($config); |
|
64 | - } |
|
65 | - return static::$application; |
|
66 | - } |
|
55 | + /** |
|
56 | + * @return Application |
|
57 | + */ |
|
58 | + public function getApplication() |
|
59 | + { |
|
60 | + if(!is_object(static::$application)){ |
|
61 | + $configFile = realpath(__DIR__.'/../../../config/config.php'); |
|
62 | + $config = include($configFile); |
|
63 | + static::$application = Application::init($config); |
|
64 | + } |
|
65 | + return static::$application; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @return \Zend\ServiceManager\ServiceManager |
|
70 | - */ |
|
71 | - public function getServiceManager() |
|
72 | - { |
|
73 | - return $this->getApplication()->getServiceManager(); |
|
74 | - } |
|
68 | + /** |
|
69 | + * @return \Zend\ServiceManager\ServiceManager |
|
70 | + */ |
|
71 | + public function getServiceManager() |
|
72 | + { |
|
73 | + return $this->getApplication()->getServiceManager(); |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * @return \Zend\EventManager\EventManagerInterface |
|
78 | - */ |
|
79 | - public function getEventManager() |
|
80 | - { |
|
81 | - return $this->getApplication()->getEventManager(); |
|
82 | - } |
|
76 | + /** |
|
77 | + * @return \Zend\EventManager\EventManagerInterface |
|
78 | + */ |
|
79 | + public function getEventManager() |
|
80 | + { |
|
81 | + return $this->getApplication()->getEventManager(); |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @return RepositoryService |
|
86 | - */ |
|
87 | - public function getRepositories() |
|
88 | - { |
|
89 | - return $this->getServiceManager()->get('repositories'); |
|
90 | - } |
|
84 | + /** |
|
85 | + * @return RepositoryService |
|
86 | + */ |
|
87 | + public function getRepositories() |
|
88 | + { |
|
89 | + return $this->getServiceManager()->get('repositories'); |
|
90 | + } |
|
91 | 91 | |
92 | - /** |
|
93 | - * @param $name |
|
94 | - * @param array $params |
|
95 | - * |
|
96 | - * @return string |
|
97 | - */ |
|
98 | - public function generateUrl($name) |
|
99 | - { |
|
100 | - return $this->minkContext->locatePath($name); |
|
101 | - } |
|
92 | + /** |
|
93 | + * @param $name |
|
94 | + * @param array $params |
|
95 | + * |
|
96 | + * @return string |
|
97 | + */ |
|
98 | + public function generateUrl($name) |
|
99 | + { |
|
100 | + return $this->minkContext->locatePath($name); |
|
101 | + } |
|
102 | 102 | |
103 | - /** |
|
104 | - * @When /^I hover over the element "([^"]*)"$/ |
|
105 | - */ |
|
106 | - public function iHoverOverTheElement($locator) |
|
107 | - { |
|
108 | - $session = $this->minkContext->getSession(); // get the mink session |
|
109 | - $element = $session->getPage()->find('css', $locator); // runs the actual query and returns the element |
|
103 | + /** |
|
104 | + * @When /^I hover over the element "([^"]*)"$/ |
|
105 | + */ |
|
106 | + public function iHoverOverTheElement($locator) |
|
107 | + { |
|
108 | + $session = $this->minkContext->getSession(); // get the mink session |
|
109 | + $element = $session->getPage()->find('css', $locator); // runs the actual query and returns the element |
|
110 | 110 | |
111 | - // errors must not pass silently |
|
112 | - if (null === $element) { |
|
113 | - throw new \InvalidArgumentException(sprintf('Could not evaluate CSS selector: "%s"', $locator)); |
|
114 | - } |
|
111 | + // errors must not pass silently |
|
112 | + if (null === $element) { |
|
113 | + throw new \InvalidArgumentException(sprintf('Could not evaluate CSS selector: "%s"', $locator)); |
|
114 | + } |
|
115 | 115 | |
116 | - // ok, let's hover it |
|
117 | - $element->mouseOver(); |
|
118 | - } |
|
116 | + // ok, let's hover it |
|
117 | + $element->mouseOver(); |
|
118 | + } |
|
119 | 119 | |
120 | - /** |
|
121 | - * @Given /^I wait for (\d+) seconds$/ |
|
122 | - */ |
|
123 | - public function iWaitForSecond($second) |
|
124 | - { |
|
125 | - sleep($second); |
|
126 | - } |
|
120 | + /** |
|
121 | + * @Given /^I wait for (\d+) seconds$/ |
|
122 | + */ |
|
123 | + public function iWaitForSecond($second) |
|
124 | + { |
|
125 | + sleep($second); |
|
126 | + } |
|
127 | 127 | |
128 | - /** |
|
129 | - * @Then /^I wait for the ajax response$/ |
|
130 | - */ |
|
131 | - public function iWaitForTheAjaxResponse() |
|
132 | - { |
|
133 | - $this->getSession()->wait(5000, '(0 === jQuery.active)'); |
|
134 | - } |
|
128 | + /** |
|
129 | + * @Then /^I wait for the ajax response$/ |
|
130 | + */ |
|
131 | + public function iWaitForTheAjaxResponse() |
|
132 | + { |
|
133 | + $this->getSession()->wait(5000, '(0 === jQuery.active)'); |
|
134 | + } |
|
135 | 135 | |
136 | - /** |
|
137 | - * Some forms do not have a Submit button just pass the ID |
|
138 | - * |
|
139 | - * @Given /^I submit the form with id "([^"]*)"$/ |
|
140 | - */ |
|
141 | - public function iSubmitTheFormWithId($arg) |
|
142 | - { |
|
143 | - $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
|
144 | - if($node) { |
|
145 | - $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
|
146 | - } else { |
|
147 | - throw new \Exception('Element not found'); |
|
148 | - } |
|
149 | - } |
|
136 | + /** |
|
137 | + * Some forms do not have a Submit button just pass the ID |
|
138 | + * |
|
139 | + * @Given /^I submit the form with id "([^"]*)"$/ |
|
140 | + */ |
|
141 | + public function iSubmitTheFormWithId($arg) |
|
142 | + { |
|
143 | + $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
|
144 | + if($node) { |
|
145 | + $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
|
146 | + } else { |
|
147 | + throw new \Exception('Element not found'); |
|
148 | + } |
|
149 | + } |
|
150 | 150 | |
151 | - /** |
|
152 | - * @Then I switch to popup :name |
|
153 | - * |
|
154 | - * @param $name |
|
155 | - */ |
|
156 | - public function iSwitchToPopup($name) |
|
157 | - { |
|
158 | - $this->iSetMainWindowName(); |
|
159 | - $this->getSession()->switchToWindow($name); |
|
160 | - } |
|
151 | + /** |
|
152 | + * @Then I switch to popup :name |
|
153 | + * |
|
154 | + * @param $name |
|
155 | + */ |
|
156 | + public function iSwitchToPopup($name) |
|
157 | + { |
|
158 | + $this->iSetMainWindowName(); |
|
159 | + $this->getSession()->switchToWindow($name); |
|
160 | + } |
|
161 | 161 | |
162 | - /** |
|
163 | - * @Then I set main window name |
|
164 | - */ |
|
165 | - public function iSetMainWindowName() |
|
166 | - { |
|
167 | - $window_name = 'main_window'; |
|
168 | - $script = 'window.name = "' . $window_name . '"'; |
|
169 | - $this->getSession()->executeScript($script); |
|
170 | - } |
|
162 | + /** |
|
163 | + * @Then I set main window name |
|
164 | + */ |
|
165 | + public function iSetMainWindowName() |
|
166 | + { |
|
167 | + $window_name = 'main_window'; |
|
168 | + $script = 'window.name = "' . $window_name . '"'; |
|
169 | + $this->getSession()->executeScript($script); |
|
170 | + } |
|
171 | 171 | |
172 | - /** |
|
173 | - * @Then I switch back to main window |
|
174 | - */ |
|
175 | - public function iSwitchBackToMainWindow() |
|
176 | - { |
|
177 | - $this->getSession()->switchToWindow('main_window'); |
|
178 | - } |
|
172 | + /** |
|
173 | + * @Then I switch back to main window |
|
174 | + */ |
|
175 | + public function iSwitchBackToMainWindow() |
|
176 | + { |
|
177 | + $this->getSession()->switchToWindow('main_window'); |
|
178 | + } |
|
179 | 179 | |
180 | - public function iVisit($url) |
|
181 | - { |
|
182 | - $this->minkContext->getSession()->visit($url); |
|
183 | - } |
|
180 | + public function iVisit($url) |
|
181 | + { |
|
182 | + $this->minkContext->getSession()->visit($url); |
|
183 | + } |
|
184 | 184 | |
185 | - /** |
|
186 | - * @When I scroll :selector into view |
|
187 | - * |
|
188 | - * @param string $selector Allowed selectors: #id, .className, //xpath |
|
189 | - * |
|
190 | - * @throws \Exception |
|
191 | - */ |
|
192 | - public function scrollIntoView($selector) |
|
193 | - { |
|
194 | - $locator = substr($selector, 0, 1); |
|
185 | + /** |
|
186 | + * @When I scroll :selector into view |
|
187 | + * |
|
188 | + * @param string $selector Allowed selectors: #id, .className, //xpath |
|
189 | + * |
|
190 | + * @throws \Exception |
|
191 | + */ |
|
192 | + public function scrollIntoView($selector) |
|
193 | + { |
|
194 | + $locator = substr($selector, 0, 1); |
|
195 | 195 | |
196 | - switch ($locator) { |
|
197 | - case '/' : // XPath selector |
|
198 | - $function = <<<JS |
|
196 | + switch ($locator) { |
|
197 | + case '/' : // XPath selector |
|
198 | + $function = <<<JS |
|
199 | 199 | (function(){ |
200 | 200 | var elem = document.evaluate($selector, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; |
201 | 201 | elem.scrollIntoView(false); |
202 | 202 | })() |
203 | 203 | JS; |
204 | - break; |
|
204 | + break; |
|
205 | 205 | |
206 | - case '#' : // ID selector |
|
207 | - $selector = substr($selector, 1); |
|
208 | - $function = <<<JS |
|
206 | + case '#' : // ID selector |
|
207 | + $selector = substr($selector, 1); |
|
208 | + $function = <<<JS |
|
209 | 209 | (function(){ |
210 | 210 | var elem = document.getElementById("$selector"); |
211 | 211 | elem.scrollIntoView(false); |
212 | 212 | })() |
213 | 213 | JS; |
214 | - break; |
|
214 | + break; |
|
215 | 215 | |
216 | - case '.' : // Class selector |
|
217 | - $selector = substr($selector, 1); |
|
218 | - $function = <<<JS |
|
216 | + case '.' : // Class selector |
|
217 | + $selector = substr($selector, 1); |
|
218 | + $function = <<<JS |
|
219 | 219 | (function(){ |
220 | 220 | var elem = document.getElementsByClassName("$selector"); |
221 | 221 | elem[0].scrollIntoView(false); |
222 | 222 | })() |
223 | 223 | JS; |
224 | - break; |
|
224 | + break; |
|
225 | 225 | |
226 | - default: |
|
227 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
228 | - break; |
|
229 | - } |
|
226 | + default: |
|
227 | + throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
228 | + break; |
|
229 | + } |
|
230 | 230 | |
231 | - try { |
|
232 | - $this->getSession()->executeScript($function); |
|
233 | - } catch (\Exception $e) { |
|
234 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
235 | - } |
|
236 | - } |
|
231 | + try { |
|
232 | + $this->getSession()->executeScript($function); |
|
233 | + } catch (\Exception $e) { |
|
234 | + throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
235 | + } |
|
236 | + } |
|
237 | 237 | |
238 | 238 | |
239 | - /** |
|
240 | - * @When I click location selector |
|
241 | - */ |
|
242 | - public function iClickLocationSelector() |
|
243 | - { |
|
244 | - $locator = '#jobBase-geoLocation-span .select2'; |
|
245 | - $element = $this->getElement($locator); |
|
246 | - $element->click(); |
|
247 | - } |
|
239 | + /** |
|
240 | + * @When I click location selector |
|
241 | + */ |
|
242 | + public function iClickLocationSelector() |
|
243 | + { |
|
244 | + $locator = '#jobBase-geoLocation-span .select2'; |
|
245 | + $element = $this->getElement($locator); |
|
246 | + $element->click(); |
|
247 | + } |
|
248 | 248 | |
249 | - /** |
|
250 | - * @param $locator |
|
251 | - * @param string $selector |
|
252 | - * |
|
253 | - * @return \Behat\Mink\Element\NodeElement|mixed|null |
|
254 | - */ |
|
255 | - public function getElement($locator,$selector='css') |
|
256 | - { |
|
257 | - $page = $this->minkContext->getSession()->getPage(); |
|
258 | - $element = $page->find('css',$locator); |
|
259 | - return $element; |
|
260 | - } |
|
249 | + /** |
|
250 | + * @param $locator |
|
251 | + * @param string $selector |
|
252 | + * |
|
253 | + * @return \Behat\Mink\Element\NodeElement|mixed|null |
|
254 | + */ |
|
255 | + public function getElement($locator,$selector='css') |
|
256 | + { |
|
257 | + $page = $this->minkContext->getSession()->getPage(); |
|
258 | + $element = $page->find('css',$locator); |
|
259 | + return $element; |
|
260 | + } |
|
261 | 261 | |
262 | - /** |
|
263 | - * @When I fill in location search with :term |
|
264 | - * @param $term |
|
265 | - */ |
|
266 | - public function iFillInLocationSearch($term) |
|
267 | - { |
|
268 | - $locator = '.select2-container--open .select2-search__field'; |
|
269 | - $element = $this->getElement($locator); |
|
270 | - $element->focus(); |
|
271 | - $element->setValue($term); |
|
272 | - $this->iWaitForTheAjaxResponse(); |
|
273 | - } |
|
262 | + /** |
|
263 | + * @When I fill in location search with :term |
|
264 | + * @param $term |
|
265 | + */ |
|
266 | + public function iFillInLocationSearch($term) |
|
267 | + { |
|
268 | + $locator = '.select2-container--open .select2-search__field'; |
|
269 | + $element = $this->getElement($locator); |
|
270 | + $element->focus(); |
|
271 | + $element->setValue($term); |
|
272 | + $this->iWaitForTheAjaxResponse(); |
|
273 | + } |
|
274 | 274 | |
275 | - public function iClickOn() |
|
276 | - { |
|
275 | + public function iClickOn() |
|
276 | + { |
|
277 | 277 | |
278 | - } |
|
278 | + } |
|
279 | 279 | |
280 | - /** |
|
281 | - * Click some text |
|
282 | - * |
|
283 | - * @When /^I click on the text "([^"]*)"$/ |
|
284 | - */ |
|
285 | - public function iClickOnTheText($text) |
|
286 | - { |
|
287 | - $session = $this->getSession(); |
|
288 | - $element = $session->getPage()->find( |
|
289 | - 'xpath', |
|
290 | - $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]') |
|
291 | - ); |
|
292 | - if(null === $element){ |
|
293 | - $element = $session->getPage()->find( |
|
294 | - 'named', |
|
295 | - array('id',$text) |
|
296 | - ); |
|
297 | - } |
|
298 | - if (null === $element) { |
|
299 | - throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |
|
300 | - } |
|
280 | + /** |
|
281 | + * Click some text |
|
282 | + * |
|
283 | + * @When /^I click on the text "([^"]*)"$/ |
|
284 | + */ |
|
285 | + public function iClickOnTheText($text) |
|
286 | + { |
|
287 | + $session = $this->getSession(); |
|
288 | + $element = $session->getPage()->find( |
|
289 | + 'xpath', |
|
290 | + $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]') |
|
291 | + ); |
|
292 | + if(null === $element){ |
|
293 | + $element = $session->getPage()->find( |
|
294 | + 'named', |
|
295 | + array('id',$text) |
|
296 | + ); |
|
297 | + } |
|
298 | + if (null === $element) { |
|
299 | + throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |
|
300 | + } |
|
301 | 301 | |
302 | - $element->click(); |
|
302 | + $element->click(); |
|
303 | 303 | |
304 | - } |
|
304 | + } |
|
305 | 305 | |
306 | 306 | /** |
307 | 307 | * @Then /^(?:|I )should see translated text "(?P<text>(?:[^"]|\\")*)"$/ |
308 | 308 | */ |
309 | - public function iShouldSeeText($text) |
|
309 | + public function iShouldSeeText($text) |
|
310 | 310 | { |
311 | 311 | $translator = $this->getServiceManager()->get('translator'); |
312 | 312 | $translated = $translator->translate($text); |
@@ -91,7 +91,6 @@ discard block |
||
91 | 91 | |
92 | 92 | /** |
93 | 93 | * @param $name |
94 | - * @param array $params |
|
95 | 94 | * |
96 | 95 | * @return string |
97 | 96 | */ |
@@ -102,6 +101,7 @@ discard block |
||
102 | 101 | |
103 | 102 | /** |
104 | 103 | * @When /^I hover over the element "([^"]*)"$/ |
104 | + * @param string $locator |
|
105 | 105 | */ |
106 | 106 | public function iHoverOverTheElement($locator) |
107 | 107 | { |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
250 | - * @param $locator |
|
250 | + * @param string $locator |
|
251 | 251 | * @param string $selector |
252 | 252 | * |
253 | - * @return \Behat\Mink\Element\NodeElement|mixed|null |
|
253 | + * @return \Behat\Mink\Element\NodeElement|null |
|
254 | 254 | */ |
255 | 255 | public function getElement($locator,$selector='css') |
256 | 256 | { |
@@ -11,23 +11,23 @@ discard block |
||
11 | 11 | |
12 | 12 | date_default_timezone_set('Europe/Berlin'); |
13 | 13 | |
14 | -if(!version_compare(PHP_VERSION, '5.6.0', 'ge')){ |
|
15 | - echo sprintf('<p>Sorry, YAWIK requires at least PHP 5.6.0 to run, but this server currently provides PHP %s</p>',PHP_VERSION); |
|
14 | +if (!version_compare(PHP_VERSION, '5.6.0', 'ge')) { |
|
15 | + echo sprintf('<p>Sorry, YAWIK requires at least PHP 5.6.0 to run, but this server currently provides PHP %s</p>', PHP_VERSION); |
|
16 | 16 | echo '<p>Please ask your servers\' administrator to install the proper PHP version.</p>'; |
17 | 17 | exit; |
18 | 18 | } |
19 | 19 | |
20 | 20 | if (php_sapi_name() == 'cli-server') { |
21 | 21 | $parseUrl = parse_url(substr($_SERVER["REQUEST_URI"], 1)); |
22 | - $route = isset($parseUrl['path']) ? $parseUrl['path']:null; |
|
23 | - if (is_file(__DIR__ . '/' . $route)) { |
|
24 | - if(substr($route, -4) == ".php"){ |
|
25 | - require __DIR__ . '/' . $route; // Include requested script files |
|
22 | + $route = isset($parseUrl['path']) ? $parseUrl['path'] : null; |
|
23 | + if (is_file(__DIR__.'/'.$route)) { |
|
24 | + if (substr($route, -4) == ".php") { |
|
25 | + require __DIR__.'/'.$route; // Include requested script files |
|
26 | 26 | exit; |
27 | 27 | } |
28 | - return false; // Serve file as is |
|
28 | + return false; // Serve file as is |
|
29 | 29 | } else { // Fallback to index.php |
30 | - $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
30 | + $_GET["q"] = $route; // Try to emulate the behaviour of a .htaccess here. |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | } else { |
48 | 48 | echo '<p>Could not initialize autoloading. This happens, if the dependencies are not installed yet.</p>'; |
49 | 49 | echo '<p>Please try to install the dependencies via: </p>'; |
50 | - echo '<code>cd '. realpath('.') .'<br>./install.sh</code>'; |
|
51 | - echo '<p>exit at ' . __FILE__ . ' in line ' . __LINE__ .'</p>'; |
|
50 | + echo '<code>cd '.realpath('.').'<br>./install.sh</code>'; |
|
51 | + echo '<p>exit at '.__FILE__.' in line '.__LINE__.'</p>'; |
|
52 | 52 | exit; |
53 | 53 | } |
54 | 54 |
@@ -51,6 +51,9 @@ discard block |
||
51 | 51 | $this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class); |
52 | 52 | } |
53 | 53 | |
54 | + /** |
|
55 | + * @param string $name |
|
56 | + */ |
|
54 | 57 | public function generateUrl($name,array $params=array(),array $options=array()) |
55 | 58 | { |
56 | 59 | $defaults = ['lang'=>'en']; |
@@ -71,7 +74,7 @@ discard block |
||
71 | 74 | } |
72 | 75 | |
73 | 76 | /** |
74 | - * @param $id |
|
77 | + * @param string $id |
|
75 | 78 | * @return mixed|object |
76 | 79 | */ |
77 | 80 | public function getService($id) |
@@ -80,7 +83,7 @@ discard block |
||
80 | 83 | } |
81 | 84 | |
82 | 85 | /** |
83 | - * @param $id |
|
86 | + * @param string $id |
|
84 | 87 | * |
85 | 88 | * @return RepositoryInterface |
86 | 89 | */ |
@@ -18,43 +18,43 @@ discard block |
||
18 | 18 | |
19 | 19 | trait CommonContextTrait |
20 | 20 | { |
21 | - /** |
|
22 | - * @var MinkContext |
|
23 | - */ |
|
24 | - protected $minkContext; |
|
21 | + /** |
|
22 | + * @var MinkContext |
|
23 | + */ |
|
24 | + protected $minkContext; |
|
25 | 25 | |
26 | - /** |
|
27 | - * @var CoreContext |
|
28 | - */ |
|
29 | - protected $coreContext; |
|
26 | + /** |
|
27 | + * @var CoreContext |
|
28 | + */ |
|
29 | + protected $coreContext; |
|
30 | 30 | |
31 | - /** |
|
32 | - * @var UserContext |
|
33 | - */ |
|
34 | - protected $userContext; |
|
31 | + /** |
|
32 | + * @var UserContext |
|
33 | + */ |
|
34 | + protected $userContext; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @var SummaryFormContext |
|
38 | - */ |
|
39 | - protected $summaryFormContext; |
|
36 | + /** |
|
37 | + * @var SummaryFormContext |
|
38 | + */ |
|
39 | + protected $summaryFormContext; |
|
40 | 40 | |
41 | - /** |
|
42 | - * @BeforeScenario |
|
43 | - * |
|
44 | - * @param BeforeScenarioScope $scope |
|
45 | - */ |
|
46 | - public function gatherContexts(BeforeScenarioScope $scope) |
|
47 | - { |
|
48 | - $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
49 | - $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class); |
|
50 | - $this->userContext = $scope->getEnvironment()->getContext(UserContext::class); |
|
51 | - $this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class); |
|
52 | - } |
|
41 | + /** |
|
42 | + * @BeforeScenario |
|
43 | + * |
|
44 | + * @param BeforeScenarioScope $scope |
|
45 | + */ |
|
46 | + public function gatherContexts(BeforeScenarioScope $scope) |
|
47 | + { |
|
48 | + $this->minkContext = $scope->getEnvironment()->getContext(MinkContext::class); |
|
49 | + $this->coreContext = $scope->getEnvironment()->getContext(CoreContext::class); |
|
50 | + $this->userContext = $scope->getEnvironment()->getContext(UserContext::class); |
|
51 | + $this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class); |
|
52 | + } |
|
53 | 53 | |
54 | - public function generateUrl($name,array $params=array(),array $options=array()) |
|
55 | - { |
|
56 | - $defaults = ['lang'=>'en']; |
|
57 | - $params = array_merge($defaults,$params); |
|
54 | + public function generateUrl($name,array $params=array(),array $options=array()) |
|
55 | + { |
|
56 | + $defaults = ['lang'=>'en']; |
|
57 | + $params = array_merge($defaults,$params); |
|
58 | 58 | /* @var Url $urlHelper */ |
59 | 59 | $urlHelper = $this |
60 | 60 | ->getService('ViewHelperManager') |
@@ -63,36 +63,36 @@ discard block |
||
63 | 63 | $url = $urlHelper($name,$params,$options); |
64 | 64 | |
65 | 65 | return $this->coreContext->generateUrl($url); |
66 | - } |
|
66 | + } |
|
67 | 67 | |
68 | - public function visit($url) |
|
69 | - { |
|
70 | - $this->coreContext->iVisit($url); |
|
71 | - } |
|
68 | + public function visit($url) |
|
69 | + { |
|
70 | + $this->coreContext->iVisit($url); |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @param $id |
|
75 | - * @return mixed|object |
|
76 | - */ |
|
77 | - public function getService($id) |
|
78 | - { |
|
79 | - return $this->coreContext->getServiceManager()->get($id); |
|
80 | - } |
|
73 | + /** |
|
74 | + * @param $id |
|
75 | + * @return mixed|object |
|
76 | + */ |
|
77 | + public function getService($id) |
|
78 | + { |
|
79 | + return $this->coreContext->getServiceManager()->get($id); |
|
80 | + } |
|
81 | 81 | |
82 | - /** |
|
83 | - * @param $id |
|
84 | - * |
|
85 | - * @return RepositoryInterface |
|
86 | - */ |
|
87 | - public function getRepository($id) |
|
88 | - { |
|
89 | - return $this->coreContext->getRepositories()->get($id); |
|
90 | - } |
|
82 | + /** |
|
83 | + * @param $id |
|
84 | + * |
|
85 | + * @return RepositoryInterface |
|
86 | + */ |
|
87 | + public function getRepository($id) |
|
88 | + { |
|
89 | + return $this->coreContext->getRepositories()->get($id); |
|
90 | + } |
|
91 | 91 | |
92 | 92 | /** |
93 | 93 | * @return UserContext |
94 | 94 | */ |
95 | - public function getUserContext() |
|
95 | + public function getUserContext() |
|
96 | 96 | { |
97 | 97 | return $this->userContext; |
98 | 98 | } |
@@ -51,16 +51,16 @@ |
||
51 | 51 | $this->summaryFormContext = $scope->getEnvironment()->getContext(SummaryFormContext::class); |
52 | 52 | } |
53 | 53 | |
54 | - public function generateUrl($name,array $params=array(),array $options=array()) |
|
54 | + public function generateUrl($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 | } |