@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function setupContexts(BeforeScenarioScope $scope) |
37 | 37 | { |
38 | - if(false === static::$jobCategoryChecked){ |
|
38 | + if (false === static::$jobCategoryChecked) { |
|
39 | 39 | /* @var Categories $catRepo */ |
40 | 40 | $catRepo = $this->getRepositories()->get('Jobs/Category'); |
41 | 41 | $all = $catRepo->findAll(); |
42 | - if(count($all) <= 1){ |
|
42 | + if (count($all) <= 1) { |
|
43 | 43 | $catRepo->createDefaultCategory('professions'); |
44 | 44 | $catRepo->createDefaultCategory('industries'); |
45 | 45 | $catRepo->createDefaultCategory('employmentTypes'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getApplication() |
55 | 55 | { |
56 | - if(!is_object(static::$application)){ |
|
56 | + if (!is_object(static::$application)) { |
|
57 | 57 | $configFile = realpath(__DIR__.'/../../../config/config.php'); |
58 | 58 | $config = include($configFile); |
59 | 59 | static::$application = Application::init($config); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public function iSubmitTheFormWithId($arg) |
138 | 138 | { |
139 | 139 | $node = $this->minkContext->getSession()->getPage()->find('css', $arg); |
140 | - if($node) { |
|
140 | + if ($node) { |
|
141 | 141 | $this->minkContext->getSession()->executeScript("jQuery('$arg').submit();"); |
142 | 142 | } else { |
143 | 143 | throw new \Exception('Element not found'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | public function iSetMainWindowName() |
162 | 162 | { |
163 | 163 | $window_name = 'main_window'; |
164 | - $script = 'window.name = "' . $window_name . '"'; |
|
164 | + $script = 'window.name = "'.$window_name.'"'; |
|
165 | 165 | $this->getSession()->executeScript($script); |
166 | 166 | } |
167 | 167 | |
@@ -220,14 +220,14 @@ discard block |
||
220 | 220 | break; |
221 | 221 | |
222 | 222 | default: |
223 | - throw new \Exception(__METHOD__ . ' Couldn\'t find selector: ' . $selector . ' - Allowed selectors: #id, .className, //xpath'); |
|
223 | + throw new \Exception(__METHOD__.' Couldn\'t find selector: '.$selector.' - Allowed selectors: #id, .className, //xpath'); |
|
224 | 224 | break; |
225 | 225 | } |
226 | 226 | |
227 | 227 | try { |
228 | 228 | $this->getSession()->executeScript($function); |
229 | 229 | } catch (\Exception $e) { |
230 | - throw new \Exception(__METHOD__ . ' failed'. ' Message: for this locator:"'.$selector.'"'); |
|
230 | + throw new \Exception(__METHOD__.' failed'.' Message: for this locator:"'.$selector.'"'); |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | * |
248 | 248 | * @return \Behat\Mink\Element\NodeElement|mixed|null |
249 | 249 | */ |
250 | - public function getElement($locator,$selector='css') |
|
250 | + public function getElement($locator, $selector = 'css') |
|
251 | 251 | { |
252 | 252 | $page = $this->minkContext->getSession()->getPage(); |
253 | - $element = $page->find('css',$locator); |
|
253 | + $element = $page->find('css', $locator); |
|
254 | 254 | return $element; |
255 | 255 | } |
256 | 256 | |
@@ -282,12 +282,12 @@ discard block |
||
282 | 282 | $session = $this->getSession(); |
283 | 283 | $element = $session->getPage()->find( |
284 | 284 | 'xpath', |
285 | - $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'. $text .'"]') |
|
285 | + $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()="'.$text.'"]') |
|
286 | 286 | ); |
287 | - if(null === $element){ |
|
287 | + if (null === $element) { |
|
288 | 288 | $element = $session->getPage()->find( |
289 | 289 | 'named', |
290 | - array('id',$text) |
|
290 | + array('id', $text) |
|
291 | 291 | ); |
292 | 292 | } |
293 | 293 | if (null === $element) { |
@@ -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); |
@@ -36,47 +36,47 @@ discard block |
||
36 | 36 | RepositoryService::class => 'repositories', |
37 | 37 | ]; |
38 | 38 | |
39 | - public function canCreate( ContainerInterface $container, $requestedName ) |
|
39 | + public function canCreate(ContainerInterface $container, $requestedName) |
|
40 | 40 | { |
41 | - return strstr( $requestedName,'\Controller') !== false; |
|
41 | + return strstr($requestedName, '\Controller') !== false; |
|
42 | 42 | } |
43 | 43 | |
44 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
44 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
45 | 45 | { |
46 | 46 | $className = $this->getClassName($requestedName); |
47 | 47 | $class = new \ReflectionClass($className); |
48 | 48 | |
49 | - if( $constructor = $class->getConstructor() ) |
|
49 | + if ($constructor = $class->getConstructor()) |
|
50 | 50 | { |
51 | - if( $params = $constructor->getParameters() ) |
|
51 | + if ($params = $constructor->getParameters()) |
|
52 | 52 | { |
53 | 53 | $constructorArgs = []; |
54 | - foreach( $params as $p ) |
|
54 | + foreach ($params as $p) |
|
55 | 55 | { |
56 | 56 | $serviceName = ''; |
57 | - if( $p->getClass() ) { |
|
57 | + if ($p->getClass()) { |
|
58 | 58 | $serviceName = $p->getClass()->getName(); |
59 | 59 | if (array_key_exists($serviceName, $this->aliases)) { |
60 | 60 | $serviceName = $this->aliases[$serviceName]; |
61 | 61 | } |
62 | 62 | } |
63 | - else{ |
|
64 | - if( $p->getName() == 'config' ){ |
|
63 | + else { |
|
64 | + if ($p->getName() == 'config') { |
|
65 | 65 | $serviceName = 'config'; |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - if(!$container->has($serviceName)){ |
|
69 | + if (!$container->has($serviceName)) { |
|
70 | 70 | throw new ServiceNotCreatedException(sprintf( |
71 | 71 | 'Can\'t create constructor argument "%s" for service "%s"', |
72 | - $p->getName(),$requestedName |
|
72 | + $p->getName(), $requestedName |
|
73 | 73 | )); |
74 | 74 | } |
75 | 75 | try { |
76 | 76 | $constructorArgs[] = $container->get($serviceName); |
77 | 77 | } |
78 | 78 | catch (\Exception $x) { |
79 | - echo __CLASS__ . " couldn't create an instance of {$p->getName()} to satisfy the constructor for $requestedName."; |
|
79 | + echo __CLASS__." couldn't create an instance of {$p->getName()} to satisfy the constructor for $requestedName."; |
|
80 | 80 | exit; |
81 | 81 | } |
82 | 82 | } |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | */ |
96 | 96 | private function getClassName($requestedName) |
97 | 97 | { |
98 | - $exp = explode('/',$requestedName); |
|
98 | + $exp = explode('/', $requestedName); |
|
99 | 99 | |
100 | - $className = array_shift($exp).'\\Controller\\'.implode('\\',$exp).'Controller'; |
|
101 | - if(!class_exists($className)){ |
|
100 | + $className = array_shift($exp).'\\Controller\\'.implode('\\', $exp).'Controller'; |
|
101 | + if (!class_exists($className)) { |
|
102 | 102 | throw new ServiceNotCreatedException( |
103 | 103 | sprintf( |
104 | 104 | 'Can\'t find correct controller class for "%s"', |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | use Core\Factory\Controller\LazyControllerFactory; |
18 | 18 | use Zend\I18n\Translator\Resources; |
19 | 19 | |
20 | -$doctrineConfig = include __DIR__ . '/doctrine.config.php'; |
|
20 | +$doctrineConfig = include __DIR__.'/doctrine.config.php'; |
|
21 | 21 | |
22 | 22 | |
23 | 23 | return array( |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | 'doctrine' => $doctrineConfig, |
26 | 26 | |
27 | 27 | 'options' => [ |
28 | - 'Core/MailServiceOptions' => [ 'class' => '\Core\Options\MailServiceOptions' ], |
|
28 | + 'Core/MailServiceOptions' => ['class' => '\Core\Options\MailServiceOptions'], |
|
29 | 29 | ], |
30 | 30 | |
31 | 31 | 'Core' => array( |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'name' => 'stream', |
46 | 46 | 'priority' => 1000, |
47 | 47 | 'options' => array( |
48 | - 'stream' => __DIR__ .'/../../../log/yawik.log', |
|
48 | + 'stream' => __DIR__.'/../../../log/yawik.log', |
|
49 | 49 | ), |
50 | 50 | ), |
51 | 51 | ), |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'name' => 'stream', |
57 | 57 | 'priority' => 1000, |
58 | 58 | 'options' => array( |
59 | - 'stream' => __DIR__ .'/../../../log/mails.log', |
|
59 | + 'stream' => __DIR__.'/../../../log/mails.log', |
|
60 | 60 | ), |
61 | 61 | ), |
62 | 62 | ), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array |
74 | 74 | 'bar' => false, // bool = enabled|Toggle nette diagnostics bar. |
75 | 75 | 'strict' => true, // bool = cause immediate death|int = matched against error severity |
76 | - 'log' => __DIR__ . '/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
76 | + 'log' => __DIR__.'/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files) |
|
77 | 77 | 'email' => null, // in production mode notifies the recipient |
78 | 78 | 'email_snooze' => 900 // interval for sending email in seconds |
79 | 79 | ], |
@@ -218,16 +218,16 @@ discard block |
||
218 | 218 | 'Core/JsonEntityHydrator' => 'Core\Entity\Hydrator\JsonEntityHydratorFactory', |
219 | 219 | 'Core/EntityHydrator' => 'Core\Entity\Hydrator\EntityHydratorFactory', |
220 | 220 | 'Core/Options' => 'Core\Factory\ModuleOptionsFactory', |
221 | - 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class,'factory'], |
|
222 | - 'DefaultListeners' => ['Core\Listener\DefaultListener','factory'], |
|
223 | - 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy','factory'], |
|
224 | - 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class,'factory'], |
|
221 | + 'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class, 'factory'], |
|
222 | + 'DefaultListeners' => ['Core\Listener\DefaultListener', 'factory'], |
|
223 | + 'templateProviderStrategy' => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy', 'factory'], |
|
224 | + 'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class, 'factory'], |
|
225 | 225 | 'Core/Listener/CreatePaginator' => 'Core\Listener\CreatePaginatorListener::factory', |
226 | 226 | 'Core/Locale' => 'Core\I18n\LocaleFactory', |
227 | 227 | \Core\Listener\AjaxRouteListener::class => \Core\Factory\Listener\AjaxRouteListenerFactory::class, |
228 | 228 | \Core\Listener\DeleteImageSetListener::class => \Core\Factory\Listener\DeleteImageSetListenerFactory::class, |
229 | 229 | 'Imagine' => \Core\Factory\Service\ImagineFactory::class, |
230 | - 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class,'factory'], |
|
230 | + 'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class, 'factory'], |
|
231 | 231 | ), |
232 | 232 | 'abstract_factories' => array( |
233 | 233 | 'Core\Factory\OptionsAbstractFactory', |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | 'translation_file_patterns' => array( |
251 | 251 | [ |
252 | 252 | 'type' => 'gettext', |
253 | - 'base_dir' => __DIR__ . '/../language', |
|
253 | + 'base_dir' => __DIR__.'/../language', |
|
254 | 254 | 'pattern' => '%s.mo', |
255 | 255 | ], |
256 | 256 | [ |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | 'Core/SearchForm' => 'Core\Factory\Controller\Plugin\SearchFormFactory', |
306 | 306 | 'listquery' => 'Core\Controller\Plugin\ListQuery::factory', |
307 | 307 | 'mail' => 'Core\Controller\Plugin\Mail::factory', |
308 | - 'Core/Mailer' => ['Core\Controller\Plugin\Mailer','factory'], |
|
309 | - 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class,'factory'], |
|
310 | - 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class,'factory'], |
|
308 | + 'Core/Mailer' => ['Core\Controller\Plugin\Mailer', 'factory'], |
|
309 | + 'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class, 'factory'], |
|
310 | + 'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class, 'factory'], |
|
311 | 311 | ), |
312 | 312 | 'invokables' => array( |
313 | 313 | 'Core/FileSender' => 'Core\Controller\Plugin\FileSender', |
@@ -337,32 +337,32 @@ discard block |
||
337 | 337 | 'exception_template' => 'error/index', |
338 | 338 | // Map template to files. Speeds up the lookup through the template stack. |
339 | 339 | 'template_map' => array( |
340 | - 'noscript-notice' => __DIR__ . '/../view/layout/_noscript-notice.phtml', |
|
341 | - 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', |
|
342 | - 'error/404' => __DIR__ . '/../view/error/404.phtml', |
|
343 | - 'error/403' => __DIR__ . '/../view/error/403.phtml', |
|
344 | - 'error/index' => __DIR__ . '/../view/error/index.phtml', |
|
345 | - 'main-navigation' => __DIR__ . '/../view/partial/main-navigation.phtml', |
|
346 | - 'pagination-control' => __DIR__ . '/../view/partial/pagination-control.phtml', |
|
347 | - 'core/loading-popup' => __DIR__ . '/../view/partial/loading-popup.phtml', |
|
348 | - 'core/notifications' => __DIR__ . '/../view/partial/notifications.phtml', |
|
349 | - 'form/core/buttons' => __DIR__ . '/../view/form/buttons.phtml', |
|
350 | - 'core/social-buttons' => __DIR__ . '/../view/partial/social-buttons.phtml', |
|
351 | - 'form/core/privacy' => __DIR__ . '/../view/form/privacy.phtml', |
|
352 | - 'core/form/permissions-fieldset' => __DIR__ . '/../view/form/permissions-fieldset.phtml', |
|
353 | - 'core/form/permissions-collection' => __DIR__ . '/../view/form/permissions-collection.phtml', |
|
354 | - 'core/form/container-view' => __DIR__ . '/../view/form/container.view.phtml', |
|
355 | - 'core/form/tree-manage.view' => __DIR__ . '/../view/form/tree-manage.view.phtml', |
|
356 | - 'core/form/tree-manage.form' => __DIR__ . '/../view/form/tree-manage.form.phtml', |
|
357 | - 'core/form/tree-add-item' => __DIR__ . '/../view/form/tree-add-item.phtml', |
|
358 | - 'mail/header' => __DIR__ . '/../view/mail/header.phtml', |
|
359 | - 'mail/footer' => __DIR__ . '/../view/mail/footer.phtml', |
|
360 | - 'mail/footer.en' => __DIR__ . '/../view/mail/footer.en.phtml', |
|
340 | + 'noscript-notice' => __DIR__.'/../view/layout/_noscript-notice.phtml', |
|
341 | + 'layout/layout' => __DIR__.'/../view/layout/layout.phtml', |
|
342 | + 'error/404' => __DIR__.'/../view/error/404.phtml', |
|
343 | + 'error/403' => __DIR__.'/../view/error/403.phtml', |
|
344 | + 'error/index' => __DIR__.'/../view/error/index.phtml', |
|
345 | + 'main-navigation' => __DIR__.'/../view/partial/main-navigation.phtml', |
|
346 | + 'pagination-control' => __DIR__.'/../view/partial/pagination-control.phtml', |
|
347 | + 'core/loading-popup' => __DIR__.'/../view/partial/loading-popup.phtml', |
|
348 | + 'core/notifications' => __DIR__.'/../view/partial/notifications.phtml', |
|
349 | + 'form/core/buttons' => __DIR__.'/../view/form/buttons.phtml', |
|
350 | + 'core/social-buttons' => __DIR__.'/../view/partial/social-buttons.phtml', |
|
351 | + 'form/core/privacy' => __DIR__.'/../view/form/privacy.phtml', |
|
352 | + 'core/form/permissions-fieldset' => __DIR__.'/../view/form/permissions-fieldset.phtml', |
|
353 | + 'core/form/permissions-collection' => __DIR__.'/../view/form/permissions-collection.phtml', |
|
354 | + 'core/form/container-view' => __DIR__.'/../view/form/container.view.phtml', |
|
355 | + 'core/form/tree-manage.view' => __DIR__.'/../view/form/tree-manage.view.phtml', |
|
356 | + 'core/form/tree-manage.form' => __DIR__.'/../view/form/tree-manage.form.phtml', |
|
357 | + 'core/form/tree-add-item' => __DIR__.'/../view/form/tree-add-item.phtml', |
|
358 | + 'mail/header' => __DIR__.'/../view/mail/header.phtml', |
|
359 | + 'mail/footer' => __DIR__.'/../view/mail/footer.phtml', |
|
360 | + 'mail/footer.en' => __DIR__.'/../view/mail/footer.en.phtml', |
|
361 | 361 | //'startpage' => __DIR__ . '/../view/layout/startpage.phtml', |
362 | 362 | ), |
363 | 363 | // Where to look for view templates not mapped above |
364 | 364 | 'template_path_stack' => array( |
365 | - __DIR__ . '/../view', |
|
365 | + __DIR__.'/../view', |
|
366 | 366 | ), |
367 | 367 | ), |
368 | 368 | 'view_helpers' => array( |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | { |
59 | 59 | $repo = static::$jobRepo; |
60 | 60 | $results = $repo->findBy(['user' => $user]); |
61 | - foreach($results as $result){ |
|
62 | - $repo->remove($result,true); |
|
61 | + foreach ($results as $result) { |
|
62 | + $repo->remove($result, true); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function beforeScenario(BeforeScenarioScope $scope) |
72 | 72 | { |
73 | 73 | $this->select2Context = $scope->getEnvironment()->getContext(Select2Context::class); |
74 | - if(is_null(static::$jobRepo)){ |
|
74 | + if (is_null(static::$jobRepo)) { |
|
75 | 75 | $this->gatherContexts($scope); |
76 | 76 | static::$jobRepo = $this->getJobRepository(); |
77 | 77 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function iGoToCreateJob() |
92 | 92 | { |
93 | - $url = $this->buildUrl('lang/jobs/manage',['action' => 'edit']); |
|
93 | + $url = $this->buildUrl('lang/jobs/manage', ['action' => 'edit']); |
|
94 | 94 | $this->visit($url); |
95 | 95 | } |
96 | 96 | |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | public function iGoToEditJobWithTitle($jobTitle) |
111 | 111 | { |
112 | 112 | $job = $this->getJobRepository()->findOneBy(['title' => $jobTitle]); |
113 | - if(!$job instanceof Job){ |
|
114 | - throw new \Exception(sprintf('Job with title "%s" is not found',$jobTitle)); |
|
113 | + if (!$job instanceof Job) { |
|
114 | + throw new \Exception(sprintf('Job with title "%s" is not found', $jobTitle)); |
|
115 | 115 | } |
116 | 116 | $this->currentJob = $job; |
117 | - $url = $this->buildUrl('lang/jobs/manage',[ |
|
117 | + $url = $this->buildUrl('lang/jobs/manage', [ |
|
118 | 118 | 'id' => $job->getId() |
119 | 119 | ]); |
120 | 120 | $this->visit($url); |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | |
141 | 141 | $jobRepository = $this->getJobRepository(); |
142 | 142 | $results = $jobRepository->getUserJobs($user->getId()); |
143 | - foreach($results as $job){ |
|
144 | - $jobRepository->remove($job,true); |
|
143 | + foreach ($results as $job) { |
|
144 | + $jobRepository->remove($job, true); |
|
145 | 145 | } |
146 | 146 | $this->currentJob = null; |
147 | 147 | } |
@@ -150,16 +150,16 @@ discard block |
||
150 | 150 | * @When I fill job location search with :search and choose :choice |
151 | 151 | * |
152 | 152 | */ |
153 | - public function iFillJobLocationAndChoose($search,$choice) |
|
153 | + public function iFillJobLocationAndChoose($search, $choice) |
|
154 | 154 | { |
155 | 155 | $select2 = $this->select2Context; |
156 | - $select2->iFillInSelect2FieldWith('jobBase[geoLocation]',$search,$choice); |
|
156 | + $select2->iFillInSelect2FieldWith('jobBase[geoLocation]', $search, $choice); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | 160 | * @When I choose :value from :field |
161 | 161 | */ |
162 | - public function iJobClassificationSelect($value,$field) |
|
162 | + public function iJobClassificationSelect($value, $field) |
|
163 | 163 | { |
164 | 164 | $field = Inflector::camelize($field); |
165 | 165 | |
@@ -175,18 +175,18 @@ discard block |
||
175 | 175 | 'employmentTypes' => "select#classifications-employmentTypes", |
176 | 176 | ]; |
177 | 177 | |
178 | - if(!isset($mapSelect2[$field])){ |
|
178 | + if (!isset($mapSelect2[$field])) { |
|
179 | 179 | throw new \Exception('Undefined field selection value "'.$field.'"'); |
180 | 180 | } |
181 | 181 | |
182 | 182 | $multipleField = $mapMultiple[$field]; |
183 | 183 | $page = $this->minkContext->getSession()->getPage(); |
184 | - $element = $page->find('css',$mapMultiple[$field]); |
|
185 | - if(!is_null($element) && $element->getAttribute('multiple')=='multiple'){ |
|
186 | - $this->minkContext->selectOption($value,$multipleField); |
|
187 | - }else{ |
|
184 | + $element = $page->find('css', $mapMultiple[$field]); |
|
185 | + if (!is_null($element) && $element->getAttribute('multiple') == 'multiple') { |
|
186 | + $this->minkContext->selectOption($value, $multipleField); |
|
187 | + } else { |
|
188 | 188 | $locator = $mapSelect2[$field]; |
189 | - $this->select2Context->iFillInSelect2Field($locator,$value); |
|
189 | + $this->select2Context->iFillInSelect2Field($locator, $value); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -210,20 +210,20 @@ discard block |
||
210 | 210 | * @When I have a :status job with the following: |
211 | 211 | * @param TableNode $fields |
212 | 212 | */ |
213 | - public function iHaveAJobWithTheFollowing($status,TableNode $fields) |
|
213 | + public function iHaveAJobWithTheFollowing($status, TableNode $fields) |
|
214 | 214 | { |
215 | - $this->buildJob($status,$fields->getRowsHash()); |
|
215 | + $this->buildJob($status, $fields->getRowsHash()); |
|
216 | 216 | } |
217 | 217 | |
218 | - public function buildJob($status, $definitions,$organization = null) |
|
218 | + public function buildJob($status, $definitions, $organization = null) |
|
219 | 219 | { |
220 | 220 | $normalizedField = [ |
221 | 221 | 'template' => 'modern', |
222 | 222 | ]; |
223 | - foreach($definitions as $field => $value){ |
|
223 | + foreach ($definitions as $field => $value) { |
|
224 | 224 | $field = Inflector::camelize($field); |
225 | - if($field == 'professions' || $field == 'industries'){ |
|
226 | - $value = explode(',',$value); |
|
225 | + if ($field == 'professions' || $field == 'industries') { |
|
226 | + $value = explode(',', $value); |
|
227 | 227 | } |
228 | 228 | $normalizedField[$field] = $value; |
229 | 229 | } |
@@ -232,49 +232,49 @@ discard block |
||
232 | 232 | $job = $jobRepo->findOneBy([ |
233 | 233 | 'title' => $normalizedField['title'] |
234 | 234 | ]); |
235 | - if(!$job instanceof Job){ |
|
235 | + if (!$job instanceof Job) { |
|
236 | 236 | $job = new Job(); |
237 | 237 | $job->setTitle($normalizedField['title']); |
238 | 238 | } |
239 | 239 | |
240 | - if(isset($normalizedField['user'])){ |
|
240 | + if (isset($normalizedField['user'])) { |
|
241 | 241 | /* @var $userRepo UserRepository */ |
242 | 242 | $userRepo = $this->getRepository('Auth\Entity\User'); |
243 | 243 | $user = $userRepo->findOneBy(['login' => $normalizedField['user']]); |
244 | - if(is_null($organization)){ |
|
244 | + if (is_null($organization)) { |
|
245 | 245 | $organization = $user->getOrganization()->getOrganization(); |
246 | 246 | } |
247 | - if($user instanceof User){ |
|
247 | + if ($user instanceof User) { |
|
248 | 248 | $job->setUser($user); |
249 | 249 | $job->setOrganization($organization); |
250 | - }else{ |
|
250 | + } else { |
|
251 | 251 | throw new \Exception('There is no user with this login:"'.$normalizedField['user'.'"']); |
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
255 | - if($status == 'draft'){ |
|
255 | + if ($status == 'draft') { |
|
256 | 256 | $job->setIsDraft(true); |
257 | - }elseif($status == 'published'){ |
|
257 | + }elseif ($status == 'published') { |
|
258 | 258 | $job->setIsDraft(false); |
259 | 259 | $job->setDatePublishStart(new \DateTime()); |
260 | 260 | } |
261 | 261 | $job->setStatus(Status::ACTIVE); |
262 | 262 | |
263 | - if(isset($normalizedField['location'])){ |
|
264 | - $this->setLocation($job,$normalizedField['location']); |
|
263 | + if (isset($normalizedField['location'])) { |
|
264 | + $this->setLocation($job, $normalizedField['location']); |
|
265 | 265 | } |
266 | - if(isset($normalizedField['professions'])){ |
|
267 | - $this->addProfessions($job,$normalizedField['professions']); |
|
266 | + if (isset($normalizedField['professions'])) { |
|
267 | + $this->addProfessions($job, $normalizedField['professions']); |
|
268 | 268 | } |
269 | 269 | |
270 | - if(isset($normalizedField['industries'])){ |
|
271 | - $this->addIndustries($job,$normalizedField['industries']); |
|
270 | + if (isset($normalizedField['industries'])) { |
|
271 | + $this->addIndustries($job, $normalizedField['industries']); |
|
272 | 272 | } |
273 | - if(isset($normalizedField['employmentTypes'])){ |
|
273 | + if (isset($normalizedField['employmentTypes'])) { |
|
274 | 274 | $types = $this->getCategories([$normalizedField['employmentTypes']]); |
275 | 275 | $type = array_shift($types); |
276 | 276 | $values = $job->getClassifications()->getEmploymentTypes()->getValues(); |
277 | - if(!is_array($values) || !in_array($type,$values)){ |
|
277 | + if (!is_array($values) || !in_array($type, $values)) { |
|
278 | 278 | $job->getClassifications()->getEmploymentTypes()->getItems()->add($type); |
279 | 279 | } |
280 | 280 | } |
@@ -294,18 +294,18 @@ discard block |
||
294 | 294 | $location->fromString($serialized); |
295 | 295 | |
296 | 296 | $locations = $job->getLocations(); |
297 | - if(count($locations)){ |
|
297 | + if (count($locations)) { |
|
298 | 298 | $locations->clear(); |
299 | 299 | } |
300 | 300 | $job->getLocations()->add($location); |
301 | 301 | } |
302 | 302 | |
303 | - private function addProfessions(Job &$job,$terms) |
|
303 | + private function addProfessions(Job &$job, $terms) |
|
304 | 304 | { |
305 | 305 | $professions = $this->getCategories($terms); |
306 | - foreach($professions as $profession){ |
|
306 | + foreach ($professions as $profession) { |
|
307 | 307 | $values = $job->getClassifications()->getProfessions()->getValues(); |
308 | - if(!is_array($values) || !in_array($profession,$values)){ |
|
308 | + if (!is_array($values) || !in_array($profession, $values)) { |
|
309 | 309 | $job->getClassifications()->getProfessions()->getItems()->add($profession); |
310 | 310 | } |
311 | 311 | } |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | private function addIndustries(Job &$job, $terms) |
315 | 315 | { |
316 | 316 | $industries = $this->getCategories($terms); |
317 | - foreach($industries as $industry){ |
|
317 | + foreach ($industries as $industry) { |
|
318 | 318 | $values = $job->getClassifications()->getIndustries()->getValues(); |
319 | - if(!is_array($values) || !in_array($industry,$values)){ |
|
319 | + if (!is_array($values) || !in_array($industry, $values)) { |
|
320 | 320 | $job->getClassifications()->getIndustries()->getItems()->add($industry); |
321 | 321 | } |
322 | 322 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | |
352 | 352 | $job = $repo->findDraft($user); |
353 | 353 | |
354 | - if(is_null($job)){ |
|
354 | + if (is_null($job)) { |
|
355 | 355 | $job = new Job(); |
356 | 356 | $job |
357 | 357 | ->setUser($user) |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | ], |
14 | 14 | ], |
15 | 15 | 'annotation' => [ |
16 | - 'paths' => [ __DIR__ . '/../src/Organizations/Entity'] |
|
16 | + 'paths' => [__DIR__.'/../src/Organizations/Entity'] |
|
17 | 17 | ], |
18 | 18 | ], |
19 | 19 | 'eventmanager' => [ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'translation_file_patterns' => [ |
41 | 41 | [ |
42 | 42 | 'type' => 'gettext', |
43 | - 'base_dir' => __DIR__ . '/../language', |
|
43 | + 'base_dir' => __DIR__.'/../language', |
|
44 | 44 | 'pattern' => '%s.mo', |
45 | 45 | ], |
46 | 46 | ], |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | 'view_manager' => [ |
67 | 67 | // Map template to files. Speeds up the lookup through the template stack. |
68 | 68 | 'template_map' => [ |
69 | - 'organizations/index/edit' => __DIR__ . '/../view/organizations/index/form.phtml', |
|
70 | - 'organizations/form/employees-fieldset' => __DIR__ . '/../view/form/employees-fieldset.phtml', |
|
71 | - 'organizations/form/employee-fieldset' => __DIR__ .'/../view/form/employee-fieldset.phtml', |
|
72 | - 'organizations/form/invite-employee-bar' => __DIR__ . '/../view/form/invite-employee-bar.phtml', |
|
73 | - 'organizations/error/no-parent' => __DIR__ . '/../view/error/no-parent.phtml', |
|
74 | - 'organizations/error/invite' => __DIR__ . '/../view/error/invite.phtml', |
|
75 | - 'organizations/mail/invite-employee' => __DIR__ . '/../view/mail/invite-employee.phtml', |
|
76 | - 'organizations/form/workflow-fieldset' => __DIR__ . '/../view/form/workflow-fieldset.phtml', |
|
69 | + 'organizations/index/edit' => __DIR__.'/../view/organizations/index/form.phtml', |
|
70 | + 'organizations/form/employees-fieldset' => __DIR__.'/../view/form/employees-fieldset.phtml', |
|
71 | + 'organizations/form/employee-fieldset' => __DIR__.'/../view/form/employee-fieldset.phtml', |
|
72 | + 'organizations/form/invite-employee-bar' => __DIR__.'/../view/form/invite-employee-bar.phtml', |
|
73 | + 'organizations/error/no-parent' => __DIR__.'/../view/error/no-parent.phtml', |
|
74 | + 'organizations/error/invite' => __DIR__.'/../view/error/invite.phtml', |
|
75 | + 'organizations/mail/invite-employee' => __DIR__.'/../view/mail/invite-employee.phtml', |
|
76 | + 'organizations/form/workflow-fieldset' => __DIR__.'/../view/form/workflow-fieldset.phtml', |
|
77 | 77 | ], |
78 | 78 | // Where to look for view templates not mapped above |
79 | 79 | 'template_path_stack' => [ |
80 | - __DIR__ . '/../view', |
|
80 | + __DIR__.'/../view', |
|
81 | 81 | ], |
82 | 82 | ], |
83 | 83 | 'form_elements' => [ |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | 'allow' => [ |
156 | 156 | 'Entity/OrganizationImage', |
157 | 157 | 'route/lang/organizations/invite', |
158 | - 'Organizations/InviteEmployee' => [ 'accept' ], |
|
158 | + 'Organizations/InviteEmployee' => ['accept'], |
|
159 | 159 | 'route/lang/organizations/profile', |
160 | 160 | 'route/lang/organizations/profileDetail', |
161 | 161 | ], |
162 | 162 | 'deny' => [ |
163 | 163 | 'route/lang/organizations', |
164 | - 'Organizations/InviteEmployee' => [ 'invite' ], |
|
164 | + 'Organizations/InviteEmployee' => ['invite'], |
|
165 | 165 | ], |
166 | 166 | ], |
167 | 167 | // recruiters are allowed to view their companies |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | 'allow' => [ |
170 | 170 | 'route/lang/organizations', |
171 | 171 | 'Organizations/InviteEmployee', |
172 | - 'Entity/Organization' => [ 'edit' => 'Organizations/Write' ], |
|
172 | + 'Entity/Organization' => ['edit' => 'Organizations/Write'], |
|
173 | 173 | 'route/lang/organizations/profile', |
174 | 174 | 'route/lang/organizations/profileDetail' |
175 | 175 | ], |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | 'organizations' => [ |
188 | 188 | 'label' => 'Organizations', |
189 | 189 | 'route' => 'lang/organizations', |
190 | - 'order' => 65, // allows to order the menu items |
|
191 | - 'resource' => 'route/lang/organizations', // if a resource is defined, the acl will be applied. |
|
190 | + 'order' => 65, // allows to order the menu items |
|
191 | + 'resource' => 'route/lang/organizations', // if a resource is defined, the acl will be applied. |
|
192 | 192 | |
193 | 193 | 'pages' => [ |
194 | 194 | 'list' => [ |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @var String |
35 | 35 | */ |
36 | - protected $repositoryName="Organizations/Organization"; |
|
36 | + protected $repositoryName = "Organizations/Organization"; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Sortable fields |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | */ |
92 | 92 | $auth = $this->authService; |
93 | 93 | $user = $auth->getUser(); |
94 | - $ignored = [null,'guest',UserInterface::ROLE_USER]; |
|
95 | - if(!in_array($user->getRole(),$ignored)){ |
|
94 | + $ignored = [null, 'guest', UserInterface::ROLE_USER]; |
|
95 | + if (!in_array($user->getRole(), $ignored)) { |
|
96 | 96 | $queryBuilder->field('permissions.view')->equals($user->getId()); |
97 | 97 | } |
98 | 98 | |
99 | - if (isset($params['q']) && $params['q'] && $params['q'] != 'en/organizations/profile' ) { |
|
99 | + if (isset($params['q']) && $params['q'] && $params['q'] != 'en/organizations/profile') { |
|
100 | 100 | $queryBuilder->text($params['q'])->language('none'); |
101 | 101 | } |
102 | 102 | |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | |
107 | 107 | $queryBuilder->sort($this->filterSort($value['sort'])); |
108 | 108 | |
109 | - if(isset($params['type']) && $params['type'] === 'profile'){ |
|
109 | + if (isset($params['type']) && $params['type'] === 'profile') { |
|
110 | 110 | //@TODO: we should use aggregate query here |
111 | 111 | $queryBuilder->field('profileSetting') |
112 | - ->in([Organization::PROFILE_ALWAYS_ENABLE,Organization::PROFILE_ACTIVE_JOBS]) |
|
112 | + ->in([Organization::PROFILE_ALWAYS_ENABLE, Organization::PROFILE_ACTIVE_JOBS]) |
|
113 | 113 | ; |
114 | 114 | |
115 | 115 | $filters = $this->getOrganizationProfileFilters($queryBuilder); |
116 | - if(count($filters) > 0){ |
|
116 | + if (count($filters) > 0) { |
|
117 | 117 | $queryBuilder->field('id')->notIn($filters); |
118 | 118 | } |
119 | 119 | |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | $results = $queryBuilder->getQuery()->execute(); |
134 | 134 | |
135 | 135 | $filters = []; |
136 | - foreach($results->toArray() as $organization){ |
|
137 | - if($organization->getProfileSetting()==Organization::PROFILE_ACTIVE_JOBS){ |
|
136 | + foreach ($results->toArray() as $organization) { |
|
137 | + if ($organization->getProfileSetting() == Organization::PROFILE_ACTIVE_JOBS) { |
|
138 | 138 | $qb = $jobRepository->createQueryBuilder(); |
139 | 139 | $qb |
140 | 140 | ->field('organization')->equals($organization->getId()) |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | ->field('isDraft')->notEqual(true) |
143 | 143 | ; |
144 | 144 | $count = $qb->getQuery()->execute()->count(); |
145 | - if($count == 0){ |
|
145 | + if ($count == 0) { |
|
146 | 146 | $filters[] = $organization->getId(); |
147 | 147 | } |
148 | 148 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | /* @TODO: $jobRepository should be removed when using aggregation query in filtering profile */ |
38 | 38 | $authService = $container->get('AuthenticationService'); |
39 | 39 | $jobRepository = $container->get('Core/RepositoryService')->get('Jobs/Job'); |
40 | - $filter = new PaginationQuery($jobRepository,$authService); |
|
40 | + $filter = new PaginationQuery($jobRepository, $authService); |
|
41 | 41 | return $filter; |
42 | 42 | } |
43 | 43 | } |