@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | if ($exception instanceof UnauthorizedImageAccessException) { |
58 | 58 | $image = __DIR__ . '/../../../../../public/images/unauthorized-access.png'; |
59 | 59 | $response->setStatusCode(Response::STATUS_CODE_403) |
60 | - ->setContent(file_get_contents($image)) |
|
61 | - ->getHeaders() |
|
62 | - ->addHeaderLine('Content-Type', 'image/png'); |
|
60 | + ->setContent(file_get_contents($image)) |
|
61 | + ->getHeaders() |
|
62 | + ->addHeaderLine('Content-Type', 'image/png'); |
|
63 | 63 | $e->stopPropagation(); |
64 | 64 | $response->sendHeaders(); |
65 | 65 | //echo file_get_contents($image); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | $application = $e->getApplication(); |
73 | - $auth = $application->getServiceManager()->get('AuthenticationService'); |
|
73 | + $auth = $application->getServiceManager()->get('AuthenticationService'); |
|
74 | 74 | |
75 | 75 | if (!$auth->hasIdentity()) { |
76 | 76 | $routeMatch = $e->getRouteMatch(); |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | $model->setTemplate($this->getExceptionTemplate()); |
103 | 103 | $e->setResult($model); |
104 | 104 | |
105 | - // $statusCode = $response->getStatusCode(); |
|
106 | - // if ($statusCode === 200) { |
|
105 | + // $statusCode = $response->getStatusCode(); |
|
106 | + // if ($statusCode === 200) { |
|
107 | 107 | $response->setStatusCode(Response::STATUS_CODE_403); |
108 | - // } |
|
108 | + // } |
|
109 | 109 | } |
110 | 110 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * Return an image, if an image was requested. |
56 | 56 | */ |
57 | 57 | if ($exception instanceof UnauthorizedImageAccessException) { |
58 | - $image = __DIR__ . '/../../../../../public/images/unauthorized-access.png'; |
|
58 | + $image = __DIR__.'/../../../../../public/images/unauthorized-access.png'; |
|
59 | 59 | $response->setStatusCode(Response::STATUS_CODE_403) |
60 | 60 | ->setContent(file_get_contents($image)) |
61 | 61 | ->getHeaders() |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $routeMatch->setParam('action', 'index'); |
79 | 79 | $query = $e->getRequest()->getQuery(); |
80 | 80 | $ref = $e->getRequest()->getRequestUri(); |
81 | - $ref = preg_replace('~^' . preg_quote($e->getRouter()->getBaseUrl()) . '~', '', $ref); |
|
81 | + $ref = preg_replace('~^'.preg_quote($e->getRouter()->getBaseUrl()).'~', '', $ref); |
|
82 | 82 | $query->set('ref', $ref); |
83 | 83 | $query->set('req', 1); |
84 | 84 | $response->setStatusCode(Response::STATUS_CODE_401); |
@@ -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 | { |
@@ -10,10 +10,10 @@ |
||
10 | 10 | use Core\Entity\IdentifiableEntityInterface; |
11 | 11 | |
12 | 12 | interface CvInterface extends EntityInterface, |
13 | - IdentifiableEntityInterface, |
|
14 | - DraftableEntityInterface, |
|
15 | - PermissionsAwareInterface, |
|
16 | - ModificationDateAwareEntityInterface |
|
13 | + IdentifiableEntityInterface, |
|
14 | + DraftableEntityInterface, |
|
15 | + PermissionsAwareInterface, |
|
16 | + ModificationDateAwareEntityInterface |
|
17 | 17 | { |
18 | 18 | |
19 | 19 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $name = $this->default; |
83 | 83 | } |
84 | 84 | |
85 | - if (!isset(static::$orderMap[ $name ])) { |
|
85 | + if (!isset(static::$orderMap[$name])) { |
|
86 | 86 | throw new \InvalidArgumentException(sprintf( |
87 | 87 | 'Unknown status name "%s" for "%s"', |
88 | 88 | $name, static::class |
@@ -90,6 +90,6 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->name = $name; |
93 | - $this->order = static::$orderMap[ $name ]; |
|
93 | + $this->order = static::$orderMap[$name]; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | \ No newline at end of file |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | protected $targetDocument = Cv::class; |
26 | 26 | |
27 | - protected $filesProperties = [ 'attachments' ]; |
|
27 | + protected $filesProperties = ['attachments']; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | public function getSubscribedEvents() |
51 | 51 | { |
52 | - return [ Events::onFlush ]; |
|
52 | + return [Events::onFlush]; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -41,6 +41,9 @@ discard block |
||
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) { |
@@ -116,7 +119,7 @@ discard block |
||
116 | 119 | /** |
117 | 120 | * Sets the history message |
118 | 121 | * |
119 | - * @param $message |
|
122 | + * @param string $message |
|
120 | 123 | * |
121 | 124 | * @return $this |
122 | 125 | */ |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * Set the View object |
21 | 21 | * |
22 | 22 | * @param Renderer $view |
23 | - * @return AbstractHelper |
|
23 | + * @return AbstractEventsHelper |
|
24 | 24 | */ |
25 | 25 | public function setView(Renderer $view) |
26 | 26 | { |
@@ -159,7 +159,6 @@ discard block |
||
159 | 159 | * |
160 | 160 | * parameter are arbitrary elements for defaults or programming flow |
161 | 161 | * |
162 | - * @param array $parameter |
|
163 | 162 | * @return null|ViewModel |
164 | 163 | * @throws \RuntimeException |
165 | 164 | */ |
@@ -366,7 +365,7 @@ discard block |
||
366 | 365 | |
367 | 366 | /** |
368 | 367 | * @param $job |
369 | - * @return mixed |
|
368 | + * @return \Jobs\Form\Job |
|
370 | 369 | */ |
371 | 370 | protected function getFormular($job) |
372 | 371 | { |
@@ -388,7 +387,7 @@ discard block |
||
388 | 387 | } |
389 | 388 | |
390 | 389 | /** |
391 | - * @param $form |
|
390 | + * @param \Jobs\Form\Job $form |
|
392 | 391 | * @param array $params |
393 | 392 | * @return ViewModel |
394 | 393 | */ |
@@ -564,7 +563,7 @@ discard block |
||
564 | 563 | } |
565 | 564 | |
566 | 565 | /** |
567 | - * @param $script |
|
566 | + * @param string $script |
|
568 | 567 | * @param array $parameter |
569 | 568 | * @return ViewModel |
570 | 569 | */ |
@@ -148,12 +148,12 @@ discard block |
||
148 | 148 | $jobEntity = $this->initializeJob()->get($this->params(), true); |
149 | 149 | |
150 | 150 | $model = new ViewModel([ |
151 | - 'portals' => $jobEntity->getPortals(), |
|
152 | - 'channels' => $channels, |
|
153 | - 'defaultCurrencyCode' => $options->defaultCurrencyCode, |
|
154 | - 'defaultTaxRate' => $options->defaultTaxRate, |
|
155 | - 'jobId' => $jobEntity->getId() |
|
156 | - ]); |
|
151 | + 'portals' => $jobEntity->getPortals(), |
|
152 | + 'channels' => $channels, |
|
153 | + 'defaultCurrencyCode' => $options->defaultCurrencyCode, |
|
154 | + 'defaultTaxRate' => $options->defaultTaxRate, |
|
155 | + 'jobId' => $jobEntity->getId() |
|
156 | + ]); |
|
157 | 157 | $model->setTemplate('jobs/partials/channel-list')->setTerminal(true); |
158 | 158 | return $model; |
159 | 159 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | 'lang/jobs/view', |
514 | 514 | array(), |
515 | 515 | array('query' => $query |
516 | - ) |
|
516 | + ) |
|
517 | 517 | ); |
518 | 518 | |
519 | 519 | $approvalLink = $this->url()->fromRoute( |
@@ -529,10 +529,10 @@ discard block |
||
529 | 529 | ); |
530 | 530 | |
531 | 531 | return array('job' => $jobEntity, |
532 | - 'diffSnapshot' => $diff, |
|
533 | - 'viewLink' => $viewLink, |
|
534 | - 'approvalLink' => $approvalLink, |
|
535 | - 'declineLink' => $declineLink); |
|
532 | + 'diffSnapshot' => $diff, |
|
533 | + 'viewLink' => $viewLink, |
|
534 | + 'approvalLink' => $approvalLink, |
|
535 | + 'declineLink' => $declineLink); |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | if (empty($user->info->email)) { |
179 | 179 | return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail')); |
180 | 180 | } |
181 | - $userOrg = $user->getOrganization(); |
|
181 | + $userOrg = $user->getOrganization(); |
|
182 | 182 | if (!$userOrg->hasAssociation() || $userOrg->getOrganization()->isDraft()) { |
183 | 183 | return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany')); |
184 | 184 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | |
211 | - $viewModel = null; |
|
211 | + $viewModel = null; |
|
212 | 212 | $this->acl($jobEntity, 'edit'); |
213 | 213 | if ($status = $params->fromQuery('status')) { |
214 | 214 | $this->changeStatus($jobEntity, $status); |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | $instanceForm = null; |
221 | 221 | $formErrorMessages = array(); |
222 | 222 | |
223 | - if (isset($formIdentifier) && $request->isPost()) { |
|
223 | + if (isset($formIdentifier) && $request->isPost()) { |
|
224 | 224 | // at this point the form get instantiated and immediately accumulated |
225 | 225 | $instanceForm = $form->getForm($formIdentifier); |
226 | 226 | if (!isset($instanceForm)) { |
227 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
227 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
228 | 228 | } |
229 | 229 | // the id may be part of the postData, but it never should be altered |
230 | 230 | $postData = $request->getPost(); |
@@ -278,20 +278,20 @@ discard block |
||
278 | 278 | $jobValid = false; |
279 | 279 | $errorMessage[] = $this->translator->translate('Accept the Terms'); |
280 | 280 | } |
281 | - $result = $formEvents->trigger('ValidateJob', $this, [ 'form' => $form ]); |
|
281 | + $result = $formEvents->trigger('ValidateJob', $this, ['form' => $form]); |
|
282 | 282 | foreach ($result as $messages) { |
283 | 283 | if (!$messages) { |
284 | 284 | continue; |
285 | 285 | } |
286 | 286 | if (!is_array($messages)) { |
287 | - $messages = [ $messages ]; |
|
287 | + $messages = [$messages]; |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | $errorMessage = array_merge($errorMessage, $messages); |
291 | 291 | $jobValid = false; |
292 | 292 | } |
293 | 293 | |
294 | - $errorMessage = '<br />' . implode('<br />', $errorMessage); |
|
294 | + $errorMessage = '<br />'.implode('<br />', $errorMessage); |
|
295 | 295 | if ($isAjax) { |
296 | 296 | if ($instanceForm instanceof SummaryForm) { |
297 | 297 | $instanceForm->setRenderMode(SummaryForm::RENDER_SUMMARY); |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | } else { |
300 | 300 | $viewHelper = 'form'; |
301 | 301 | } |
302 | - $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
302 | + $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
303 | 303 | $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm); |
304 | 304 | $viewModel = new JsonModel( |
305 | 305 | array( |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | } |
324 | 324 | } else { |
325 | - $formEvents->trigger('DisableElements', $this, [ 'form' => $form, 'job'=>$jobEntity ]); |
|
325 | + $formEvents->trigger('DisableElements', $this, ['form' => $form, 'job'=>$jobEntity]); |
|
326 | 326 | // Job is deployed, some changes are now disabled |
327 | 327 | $form->enableAll(); |
328 | 328 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | $completionLink = $this->url()->fromRoute( |
332 | 332 | 'lang/jobs/completion', |
333 | - [ 'id' => $jobEntity->getId()] |
|
333 | + ['id' => $jobEntity->getId()] |
|
334 | 334 | ); |
335 | 335 | |
336 | 336 | $viewModel = $this->getViewModel($form); |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | // array with differences between the last snapshot and the actual entity |
502 | 502 | // is remains Null if there is no snapshot |
503 | 503 | // it will be an empty array if the snapshot and the actual entity do not differ |
504 | - $diff = null; |
|
504 | + $diff = null; |
|
505 | 505 | |
506 | 506 | |
507 | 507 | if ($params == 'declined') { |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | */ |
561 | 561 | public function deactivateAction() |
562 | 562 | { |
563 | - $user = $this->auth->getUser(); |
|
563 | + $user = $this->auth->getUser(); |
|
564 | 564 | |
565 | 565 | $jobEntity = $this->initializeJob()->get($this->params()); |
566 | 566 |