@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function getParent($returnSelf = false) |
235 | 235 | { |
236 | - return $this->parent ? : ($returnSelf ? $this : null); |
|
236 | + return $this->parent ?: ($returnSelf ? $this : null); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | */ |
466 | 466 | public function getPermissionsResourceId() |
467 | 467 | { |
468 | - return 'organization:' . $this->getId(); |
|
468 | + return 'organization:'.$this->getId(); |
|
469 | 469 | } |
470 | 470 | |
471 | 471 | /** |
@@ -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', |
@@ -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 | { |
@@ -109,8 +109,7 @@ |
||
109 | 109 | if ('file-uri' === $params->fromPost('return')) { |
110 | 110 | $content = $viewHelperManager->get('basepath') |
111 | 111 | ->__invoke($form->getHydrator()->getLastUploadedFile()->getUri()); |
112 | - } |
|
113 | - else { |
|
112 | + } else { |
|
114 | 113 | if ($form instanceof SummaryFormInterface) { |
115 | 114 | $form->setRenderMode(SummaryFormInterface::RENDER_SUMMARY); |
116 | 115 | $viewHelper = 'summaryform'; |
@@ -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 = |
@@ -41,8 +41,8 @@ |
||
41 | 41 | $fileId = new \MongoId($file->id); |
42 | 42 | $dm = $eventArgs->getDocumentManager(); |
43 | 43 | $dm->createQueryBuilder('Cv\Entity\Cv') |
44 | - ->update()->multiple(true) |
|
45 | - ->field('attachments')->equals($fileId)->pull($fileId) |
|
46 | - ->getQuery()->execute(); |
|
44 | + ->update()->multiple(true) |
|
45 | + ->field('attachments')->equals($fileId)->pull($fileId) |
|
46 | + ->getQuery()->execute(); |
|
47 | 47 | } |
48 | 48 | } |
@@ -31,6 +31,6 @@ |
||
31 | 31 | */ |
32 | 32 | public function getUri() |
33 | 33 | { |
34 | - return "/file/Cv.Attachment/" . $this->id . "/" .urlencode($this->name); |
|
34 | + return "/file/Cv.Attachment/".$this->id."/".urlencode($this->name); |
|
35 | 35 | } |
36 | 36 | } |
@@ -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 | * |