@@ -86,7 +86,6 @@ |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | - * @param HelperPluginManager $helperPluginManager |
|
90 | 89 | * @return Services |
91 | 90 | */ |
92 | 91 | public static function factory($sm) |
@@ -173,6 +173,9 @@ |
||
173 | 173 | return $this->redirect()->refresh(); |
174 | 174 | } |
175 | 175 | |
176 | + /** |
|
177 | + * @param \Cv\Repository\Cv $repository |
|
178 | + */ |
|
176 | 179 | private function getCv($repository, $user) |
177 | 180 | { |
178 | 181 | $id = |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
189 | - * @return ArrayCollection |
|
189 | + * @return IdentityWrapper |
|
190 | 190 | */ |
191 | 191 | public function getEducationsIndexedById() |
192 | 192 | { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
218 | - * @return ArrayCollection |
|
218 | + * @return IdentityWrapper |
|
219 | 219 | */ |
220 | 220 | public function getEmploymentsIndexedById() |
221 | 221 | { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * @return ArrayCollection |
|
247 | + * @return IdentityWrapper |
|
248 | 248 | */ |
249 | 249 | public function getSkillsIndexedById() |
250 | 250 | { |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
325 | - * @return ArrayCollection |
|
325 | + * @return IdentityWrapper |
|
326 | 326 | */ |
327 | 327 | public function getLanguageSkillsIndexedById() |
328 | 328 | { |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
363 | - * @param Status|string $status |
|
363 | + * @param string $status |
|
364 | 364 | */ |
365 | 365 | public function setStatus($status) |
366 | 366 | { |
@@ -407,6 +407,9 @@ discard block |
||
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
410 | + /** |
|
411 | + * @param UserInterface $oldUser |
|
412 | + */ |
|
410 | 413 | private function updatePermissions($oldUser = null) |
411 | 414 | { |
412 | 415 | $hasPermissions = (bool) $this->permissions; |
@@ -60,11 +60,11 @@ |
||
60 | 60 | protected $skills; |
61 | 61 | |
62 | 62 | /** |
63 | - * Skills |
|
64 | - * |
|
65 | - * @var ArrayCollection |
|
66 | - * @ODM\EmbedMany(targetDocument="\Cv\Entity\Language") |
|
67 | - */ |
|
63 | + * Skills |
|
64 | + * |
|
65 | + * @var ArrayCollection |
|
66 | + * @ODM\EmbedMany(targetDocument="\Cv\Entity\Language") |
|
67 | + */ |
|
68 | 68 | protected $languageSkills; |
69 | 69 | |
70 | 70 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @var array |
83 | 83 | * @ODM\Field(type="collection") |
84 | 84 | */ |
85 | - protected $nativeLanguages=[]; |
|
85 | + protected $nativeLanguages = []; |
|
86 | 86 | |
87 | 87 | |
88 | 88 | /** |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | public function setIsDraft($isDraft) |
269 | 269 | { |
270 | - $this->isDraft=$isDraft; |
|
270 | + $this->isDraft = $isDraft; |
|
271 | 271 | return $this; |
272 | 272 | } |
273 | 273 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | */ |
338 | 338 | public function setNativeLanguages($nativeLanguages) |
339 | 339 | { |
340 | - $this->nativeLanguages=$nativeLanguages; |
|
340 | + $this->nativeLanguages = $nativeLanguages; |
|
341 | 341 | return $this; |
342 | 342 | } |
343 | 343 |
@@ -93,7 +93,7 @@ |
||
93 | 93 | /** |
94 | 94 | * Gets the the maximum number of allowed attachments |
95 | 95 | * |
96 | - * @return string |
|
96 | + * @return integer |
|
97 | 97 | */ |
98 | 98 | public function getAttachmentsCount() |
99 | 99 | { |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * |
35 | 35 | * @var array $attachmentsMimeType |
36 | 36 | */ |
37 | - protected $attachmentsMimeType = array('image','applications/pdf', |
|
37 | + protected $attachmentsMimeType = array('image', 'applications/pdf', |
|
38 | 38 | 'application/x-pdf', |
39 | 39 | 'application/acrobat', |
40 | 40 | 'applications/vnd.pdf', |
@@ -22,7 +22,7 @@ |
||
22 | 22 | * Look for an drafted Document of a given user |
23 | 23 | * |
24 | 24 | * @param $user |
25 | - * @return CvEntity|null |
|
25 | + * @return \MongoCursor |
|
26 | 26 | */ |
27 | 27 | public function findDraft($user) |
28 | 28 | { |
@@ -38,6 +38,9 @@ discard block |
||
38 | 38 | protected $country; |
39 | 39 | |
40 | 40 | |
41 | + /** |
|
42 | + * @param string $uri |
|
43 | + */ |
|
41 | 44 | public function __construct($uri, $country="DE", $cache = false) |
42 | 45 | { |
43 | 46 | $this->country = $country; |
@@ -92,6 +95,9 @@ discard block |
||
92 | 95 | return isset($result[0]) ? $result[0] : false; |
93 | 96 | } |
94 | 97 | |
98 | + /** |
|
99 | + * @param string $result |
|
100 | + */ |
|
95 | 101 | protected function processResult($result) |
96 | 102 | { |
97 | 103 | return $result; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | protected $country; |
39 | 39 | |
40 | 40 | |
41 | - public function __construct($uri, $country="DE", $cache = false) |
|
41 | + public function __construct($uri, $country = "DE", $cache = false) |
|
42 | 42 | { |
43 | 43 | $this->country = $country; |
44 | 44 | $this->client = $this->setupClient($uri); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $response = $this->client->send(); |
74 | 74 | if ($response->getStatusCode() !== 200) { |
75 | - throw new \RuntimeException('Query failed, because ' . $response->getReasonPhrase()); |
|
75 | + throw new \RuntimeException('Query failed, because '.$response->getReasonPhrase()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $result = $response->getBody(); |
@@ -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 | /** |
@@ -227,11 +227,11 @@ discard block |
||
227 | 227 | protected function save() |
228 | 228 | { |
229 | 229 | $formEvents = $this->jobFormEvents; |
230 | - $user = $this->auth->getUser(); |
|
230 | + $user = $this->auth->getUser(); |
|
231 | 231 | if (empty($user->getInfo()->getEmail())) { |
232 | 232 | return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail')); |
233 | 233 | } |
234 | - $userOrg = $user->getOrganization(); |
|
234 | + $userOrg = $user->getOrganization(); |
|
235 | 235 | if (!$userOrg->hasAssociation() || $userOrg->getOrganization()->isDraft()) { |
236 | 236 | return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany')); |
237 | 237 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | } |
262 | 262 | |
263 | 263 | |
264 | - $viewModel = null; |
|
264 | + $viewModel = null; |
|
265 | 265 | $this->acl($jobEntity, 'edit'); |
266 | 266 | if ($status = $params->fromQuery('status')) { |
267 | 267 | $this->changeStatus($jobEntity, $status); |
@@ -273,11 +273,11 @@ discard block |
||
273 | 273 | $instanceForm = null; |
274 | 274 | $formErrorMessages = array(); |
275 | 275 | |
276 | - if (isset($formIdentifier) && $request->isPost()) { |
|
276 | + if (isset($formIdentifier) && $request->isPost()) { |
|
277 | 277 | // at this point the form get instantiated and immediately accumulated |
278 | 278 | $instanceForm = $form->getForm($formIdentifier); |
279 | 279 | if (!isset($instanceForm)) { |
280 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
280 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
281 | 281 | } |
282 | 282 | // the id may be part of the postData, but it never should be altered |
283 | 283 | $postData = $request->getPost(); |
@@ -331,20 +331,20 @@ discard block |
||
331 | 331 | $jobValid = false; |
332 | 332 | $errorMessage[] = $this->translator->translate('Accept the Terms'); |
333 | 333 | } |
334 | - $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]); |
|
334 | + $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]); |
|
335 | 335 | foreach ($result as $messages) { |
336 | 336 | if (!$messages) { |
337 | 337 | continue; |
338 | 338 | } |
339 | 339 | if (!is_array($messages)) { |
340 | - $messages = [ $messages ]; |
|
340 | + $messages = [$messages]; |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | $errorMessage = array_merge($errorMessage, $messages); |
344 | 344 | $jobValid = false; |
345 | 345 | } |
346 | 346 | |
347 | - $errorMessage = '<br />' . implode('<br />', $errorMessage); |
|
347 | + $errorMessage = '<br />'.implode('<br />', $errorMessage); |
|
348 | 348 | if ($isAjax) { |
349 | 349 | if ($instanceForm instanceof SummaryForm) { |
350 | 350 | $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | } else { |
353 | 353 | $viewHelper = 'form'; |
354 | 354 | } |
355 | - $viewHelperManager = $this->viewHelper; |
|
355 | + $viewHelperManager = $this->viewHelper; |
|
356 | 356 | $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm); |
357 | 357 | $viewModel = new JsonModel( |
358 | 358 | array( |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | } |
378 | 378 | } else { |
379 | - $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]); |
|
379 | + $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]); |
|
380 | 380 | // Job is deployed, some changes are now disabled |
381 | 381 | $form->enableAll(); |
382 | 382 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | |
385 | 385 | $completionLink = $this->url()->fromRoute( |
386 | 386 | 'lang/jobs/completion', |
387 | - [ 'id' => $jobEntity->getId()] |
|
387 | + ['id' => $jobEntity->getId()] |
|
388 | 388 | ); |
389 | 389 | |
390 | 390 | $viewModel = $this->getViewModel($form); |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | protected function getFormular($job) |
451 | 451 | { |
452 | 452 | /* @var $forms \Zend\Form\FormElementManager\FormElementManagerV3Polyfill */ |
453 | - $forms = $this->formManager; |
|
453 | + $forms = $this->formManager; |
|
454 | 454 | /* @var $container \Jobs\Form\Job */ |
455 | 455 | |
456 | 456 | $container = $forms->get( |
@@ -552,15 +552,15 @@ discard block |
||
552 | 552 | $jobEvent->setJobEntity($jobEntity); |
553 | 553 | $jobEvent->addPortal('XingVendorApi'); |
554 | 554 | $jobEvent->setTarget($this); |
555 | - $jobEvents = $this->jobEvents; |
|
555 | + $jobEvents = $this->jobEvents; |
|
556 | 556 | // array with differences between the last snapshot and the actual entity |
557 | 557 | // is remains Null if there is no snapshot |
558 | 558 | // it will be an empty array if the snapshot and the actual entity do not differ |
559 | - $diff = null; |
|
559 | + $diff = null; |
|
560 | 560 | |
561 | 561 | |
562 | 562 | if ($params == 'declined') { |
563 | - if ($jobEntity instanceOf JobSnapshot) { |
|
563 | + if ($jobEntity instanceOf JobSnapshot) { |
|
564 | 564 | $jobEntity->getOriginalEntity()->changeStatus( |
565 | 565 | Status::ACTIVE, |
566 | 566 | sprintf( |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | */ |
639 | 639 | public function deactivateAction() |
640 | 640 | { |
641 | - $user = $this->auth->getUser(); |
|
641 | + $user = $this->auth->getUser(); |
|
642 | 642 | |
643 | 643 | $jobEntity = $this->initializeJob()->get($this->params()); |
644 | 644 |
@@ -82,6 +82,7 @@ |
||
82 | 82 | * Generates a location array |
83 | 83 | * |
84 | 84 | * @param Collection $locations, |
85 | + * @param string $locations |
|
85 | 86 | * |
86 | 87 | * @return array |
87 | 88 | */ |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $dateEnd->add(new \DateInterval("P180D")); |
59 | 59 | $dateEnd = $dateEnd->format('Y-m-d H:i:s'); |
60 | 60 | } |
61 | - $array=[ |
|
61 | + $array = [ |
|
62 | 62 | '@context'=>'http://schema.org/', |
63 | 63 | '@type' => 'JobPosting', |
64 | 64 | 'title' => $this->job->getTitle(), |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | private function getLocations($locations) |
95 | 95 | { |
96 | - $array=[]; |
|
96 | + $array = []; |
|
97 | 97 | foreach ($locations as $location) { /* @var \Core\Entity\LocationInterface $location */ |
98 | 98 | array_push( |
99 | 99 | $array, |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | '@type' => 'Place', |
102 | 102 | 'address' => [ |
103 | 103 | '@type' => 'PostalAddress', |
104 | - 'streetAddress' => $location->getStreetname() .' '.$location->getStreetnumber(), |
|
104 | + 'streetAddress' => $location->getStreetname().' '.$location->getStreetnumber(), |
|
105 | 105 | 'postalCode' => $location->getPostalCode(), |
106 | 106 | 'addressLocality' => $location->getCity(), |
107 | 107 | 'addressCountry' => $location->getCountry(), |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | private function getDescription(TemplateValuesInterface $values) |
124 | 124 | { |
125 | - $description=sprintf( |
|
125 | + $description = sprintf( |
|
126 | 126 | "<p>%s</p>". |
127 | 127 | "<h1>%s</h1>". |
128 | 128 | "<h3>Requirements</h3><p>%s</p>". |
@@ -41,6 +41,9 @@ |
||
41 | 41 | */ |
42 | 42 | protected $message; |
43 | 43 | |
44 | + /** |
|
45 | + * @param StatusInterface|null $status |
|
46 | + */ |
|
44 | 47 | public function __construct($status, $message = '[System]') |
45 | 48 | { |
46 | 49 | if (!$status instanceof StatusInterface) { |