@@ -48,7 +48,7 @@ |
||
| 48 | 48 | break; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $config = $container->get('Config'); |
|
| 51 | + $config = $container->get('Config'); |
|
| 52 | 52 | |
| 53 | 53 | if (isset($config['view_manager'])) { |
| 54 | 54 | if (isset($config['view_manager']['display_exceptions'])) { |
@@ -22,6 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * @param AttachableEntityManager $attachableEntityManager |
| 24 | 24 | * @throws \LogicException If attachable entity manager is already set |
| 25 | + * @return AttachableEntityTrait |
|
| 25 | 26 | */ |
| 26 | 27 | public function setAttachableEntityManager(AttachableEntityManager $attachableEntityManager); |
| 27 | 28 | |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | /** |
| 79 | 79 | * @see AttachableEntityInterface::createAttachedEntity() |
| 80 | 80 | */ |
| 81 | - public function createAttachedEntity($entityClass, $values = [], $key=null) |
|
| 81 | + public function createAttachedEntity($entityClass, $values = [], $key = null) |
|
| 82 | 82 | { |
| 83 | 83 | return $this->getAttachableEntityManager()->createAttachedEntity($entityClass, $values, $key); |
| 84 | 84 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | private function fromEvent($name, $values) |
| 91 | 91 | { |
| 92 | - $event = $this->events->getEvent($name, $this, $values); |
|
| 92 | + $event = $this->events->getEvent($name, $this, $values); |
|
| 93 | 93 | $results = $this->events->triggerEvent($event); |
| 94 | 94 | |
| 95 | 95 | $snippets = []; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $content = $item['content']; |
| 139 | 139 | |
| 140 | 140 | foreach ($values as $key => $val) { |
| 141 | - $content = str_replace('%' . $key . '%', $val, $content); |
|
| 141 | + $content = str_replace('%'.$key.'%', $val, $content); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | return $content; |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | * </pre> |
| 103 | 103 | * |
| 104 | 104 | * @param string $subject |
| 105 | - * @param bool|mixed $translate |
|
| 105 | + * @param string $translate |
|
| 106 | 106 | * |
| 107 | 107 | * @since 0.19 |
| 108 | 108 | * @since 0.29 Add sprintf support for translation |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | * |
| 177 | 177 | * @param string $fullName |
| 178 | 178 | * |
| 179 | - * @return array|bool |
|
| 179 | + * @return string |
|
| 180 | 180 | */ |
| 181 | 181 | protected function getOptionsConfig($fullName) |
| 182 | 182 | { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | /** |
| 241 | 241 | * Gets all comments for the application. |
| 242 | 242 | * |
| 243 | - * @return ArrayCollection; |
|
| 243 | + * @return Collection |
|
| 244 | 244 | |
| 245 | 245 | */ |
| 246 | 246 | public function getComments(); |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | /** |
| 272 | 272 | * Gets all attributes for an application. |
| 273 | 273 | * |
| 274 | - * @return ArrayCollection; |
|
| 274 | + * @return Attributes |
|
| 275 | 275 | |
| 276 | 276 | */ |
| 277 | 277 | public function getAttributes(); |
@@ -241,7 +241,6 @@ discard block |
||
| 241 | 241 | * Gets all comments for the application. |
| 242 | 242 | * |
| 243 | 243 | * @return ArrayCollection; |
| 244 | - |
|
| 245 | 244 | */ |
| 246 | 245 | public function getComments(); |
| 247 | 246 | |
@@ -272,7 +271,6 @@ discard block |
||
| 272 | 271 | * Gets all attributes for an application. |
| 273 | 272 | * |
| 274 | 273 | * @return ArrayCollection; |
| 275 | - |
|
| 276 | 274 | */ |
| 277 | 275 | public function getAttributes(); |
| 278 | 276 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * returns the number of years of the education or work experience |
| 19 | 19 | * |
| 20 | 20 | * @param array $array |
| 21 | - * @return string |
|
| 21 | + * @return double |
|
| 22 | 22 | */ |
| 23 | 23 | public function __invoke($array) |
| 24 | 24 | { |
@@ -25,13 +25,13 @@ |
||
| 25 | 25 | // calculate EndDate - StartDate = X Years. |
| 26 | 26 | // eg. 4.2 Years |
| 27 | 27 | |
| 28 | - $days=0; |
|
| 28 | + $days = 0; |
|
| 29 | 29 | foreach ($array as $obj) { |
| 30 | 30 | $date1 = new \DateTime($obj->getEndDate()); |
| 31 | 31 | $date2 = new \DateTime($obj->getStartDate()); |
| 32 | 32 | $interval = $date1->diff($date2); |
| 33 | - $days+=abs($interval->format('%R%a')); |
|
| 33 | + $days += abs($interval->format('%R%a')); |
|
| 34 | 34 | } |
| 35 | - return round($days/365, 1); |
|
| 35 | + return round($days / 365, 1); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -165,7 +165,6 @@ discard block |
||
| 165 | 165 | * |
| 166 | 166 | * parameter are arbitrary elements for defaults or programming flow |
| 167 | 167 | * |
| 168 | - * @param array $parameter |
|
| 169 | 168 | * @return null|ViewModel |
| 170 | 169 | * @throws \RuntimeException |
| 171 | 170 | */ |
@@ -388,7 +387,7 @@ discard block |
||
| 388 | 387 | |
| 389 | 388 | /** |
| 390 | 389 | * @param $job \Jobs\Entity\Job |
| 391 | - * @return mixed |
|
| 390 | + * @return \Jobs\Form\Job |
|
| 392 | 391 | */ |
| 393 | 392 | protected function getFormular($job) |
| 394 | 393 | { |
@@ -411,7 +410,7 @@ discard block |
||
| 411 | 410 | } |
| 412 | 411 | |
| 413 | 412 | /** |
| 414 | - * @param $form |
|
| 413 | + * @param \Jobs\Form\Job $form |
|
| 415 | 414 | * @param array $params |
| 416 | 415 | * @return ViewModel |
| 417 | 416 | */ |
@@ -604,7 +603,7 @@ discard block |
||
| 604 | 603 | } |
| 605 | 604 | |
| 606 | 605 | /** |
| 607 | - * @param $script |
|
| 606 | + * @param string $script |
|
| 608 | 607 | * @param array $parameter |
| 609 | 608 | * @return ViewModel |
| 610 | 609 | */ |
@@ -66,16 +66,16 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | protected $translator; |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * @var FilterPluginManager |
|
| 71 | - */ |
|
| 69 | + /** |
|
| 70 | + * @var FilterPluginManager |
|
| 71 | + */ |
|
| 72 | 72 | protected $filterManager; |
| 73 | 73 | |
| 74 | 74 | protected $jobFormEvents; |
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * @var |
|
| 78 | - */ |
|
| 76 | + /** |
|
| 77 | + * @var |
|
| 78 | + */ |
|
| 79 | 79 | protected $formManager; |
| 80 | 80 | |
| 81 | 81 | protected $options; |
@@ -88,35 +88,35 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | protected $jobEvent; |
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * ManageController constructor. |
|
| 93 | - * |
|
| 94 | - * @TODO: [ZF3] make this controller more thin, looks like so much things to do |
|
| 95 | - * |
|
| 96 | - * @param AuthenticationService $auth |
|
| 97 | - * @param RepositoryService $repositoryService |
|
| 98 | - * @param TranslatorInterface $translator |
|
| 99 | - * @param FilterPluginManager $filterManager |
|
| 100 | - * @param EventManagerInterface $jobFormEvents |
|
| 101 | - * @param $formManager |
|
| 102 | - * @param $options |
|
| 103 | - * @param HelperPluginManager $viewHelper |
|
| 104 | - * @param ValidatorPluginManager $validatorManager |
|
| 105 | - * @param EventManagerInterface $jobEvents |
|
| 106 | - * @param EventInterface $jobEvent |
|
| 107 | - */ |
|
| 91 | + /** |
|
| 92 | + * ManageController constructor. |
|
| 93 | + * |
|
| 94 | + * @TODO: [ZF3] make this controller more thin, looks like so much things to do |
|
| 95 | + * |
|
| 96 | + * @param AuthenticationService $auth |
|
| 97 | + * @param RepositoryService $repositoryService |
|
| 98 | + * @param TranslatorInterface $translator |
|
| 99 | + * @param FilterPluginManager $filterManager |
|
| 100 | + * @param EventManagerInterface $jobFormEvents |
|
| 101 | + * @param $formManager |
|
| 102 | + * @param $options |
|
| 103 | + * @param HelperPluginManager $viewHelper |
|
| 104 | + * @param ValidatorPluginManager $validatorManager |
|
| 105 | + * @param EventManagerInterface $jobEvents |
|
| 106 | + * @param EventInterface $jobEvent |
|
| 107 | + */ |
|
| 108 | 108 | public function __construct( |
| 109 | - AuthenticationService $auth, |
|
| 110 | - RepositoryService $repositoryService, |
|
| 111 | - TranslatorInterface $translator, |
|
| 112 | - FilterPluginManager $filterManager, |
|
| 113 | - EventManagerInterface $jobFormEvents, |
|
| 114 | - $formManager, |
|
| 115 | - $options, |
|
| 116 | - HelperPluginManager $viewHelper, |
|
| 117 | - ValidatorPluginManager $validatorManager, |
|
| 118 | - EventManagerInterface $jobEvents, |
|
| 119 | - EventInterface $jobEvent |
|
| 109 | + AuthenticationService $auth, |
|
| 110 | + RepositoryService $repositoryService, |
|
| 111 | + TranslatorInterface $translator, |
|
| 112 | + FilterPluginManager $filterManager, |
|
| 113 | + EventManagerInterface $jobFormEvents, |
|
| 114 | + $formManager, |
|
| 115 | + $options, |
|
| 116 | + HelperPluginManager $viewHelper, |
|
| 117 | + ValidatorPluginManager $validatorManager, |
|
| 118 | + EventManagerInterface $jobEvents, |
|
| 119 | + EventInterface $jobEvent |
|
| 120 | 120 | ) |
| 121 | 121 | { |
| 122 | 122 | $this->auth = $auth; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | $routeMatch = $e->getRouteMatch(); |
| 159 | 159 | $action = $routeMatch->getParam('action'); |
| 160 | - $services = $e->getApplication()->getServiceManager(); |
|
| 160 | + $services = $e->getApplication()->getServiceManager(); |
|
| 161 | 161 | if (in_array($action, array('edit', 'approval', 'completion'))) { |
| 162 | 162 | $jobEvents = $services->get('Jobs/Events'); |
| 163 | 163 | $mailSender = $services->get('Jobs/Listener/MailSender'); |
@@ -202,12 +202,12 @@ discard block |
||
| 202 | 202 | $jobEntity = $this->initializeJob()->get($this->params(), true); |
| 203 | 203 | |
| 204 | 204 | $model = new ViewModel([ |
| 205 | - 'portals' => $jobEntity->getPortals(), |
|
| 206 | - 'channels' => $channels, |
|
| 207 | - 'defaultCurrencyCode' => $options->defaultCurrencyCode, |
|
| 208 | - 'defaultTaxRate' => $options->defaultTaxRate, |
|
| 209 | - 'jobId' => $jobEntity->getId() |
|
| 210 | - ]); |
|
| 205 | + 'portals' => $jobEntity->getPortals(), |
|
| 206 | + 'channels' => $channels, |
|
| 207 | + 'defaultCurrencyCode' => $options->defaultCurrencyCode, |
|
| 208 | + 'defaultTaxRate' => $options->defaultTaxRate, |
|
| 209 | + 'jobId' => $jobEntity->getId() |
|
| 210 | + ]); |
|
| 211 | 211 | $model->setTemplate('jobs/partials/channel-list')->setTerminal(true); |
| 212 | 212 | return $model; |
| 213 | 213 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | protected function save() |
| 227 | 227 | { |
| 228 | - $formEvents = $this->jobFormEvents; |
|
| 228 | + $formEvents = $this->jobFormEvents; |
|
| 229 | 229 | $user = $this->auth->getUser(); |
| 230 | 230 | if (empty($user->getInfo()->getEmail())) { |
| 231 | 231 | return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail')); |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | 'lang/jobs/view', |
| 585 | 585 | array(), |
| 586 | 586 | array('query' => $query |
| 587 | - ) |
|
| 587 | + ) |
|
| 588 | 588 | ); |
| 589 | 589 | |
| 590 | 590 | $approvalLink = $this->url()->fromRoute( |
@@ -600,10 +600,10 @@ discard block |
||
| 600 | 600 | ); |
| 601 | 601 | |
| 602 | 602 | return array('job' => $jobEntity, |
| 603 | - 'diffSnapshot' => $diff, |
|
| 604 | - 'viewLink' => $viewLink, |
|
| 605 | - 'approvalLink' => $approvalLink, |
|
| 606 | - 'declineLink' => $declineLink); |
|
| 603 | + 'diffSnapshot' => $diff, |
|
| 604 | + 'viewLink' => $viewLink, |
|
| 605 | + 'approvalLink' => $approvalLink, |
|
| 606 | + 'declineLink' => $declineLink); |
|
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | /** |
@@ -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 | |