@@ -250,6 +250,9 @@ |
||
250 | 250 | return $container; |
251 | 251 | } |
252 | 252 | |
253 | + /** |
|
254 | + * @param string $script |
|
255 | + */ |
|
253 | 256 | protected function getErrorViewModel($script) |
254 | 257 | { |
255 | 258 | $this->getResponse()->setStatusCode(Response::STATUS_CODE_500); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | try { |
125 | 125 | /* @var $handler \Organizations\Controller\Plugin\GetOrganizationHandler */ |
126 | 126 | $handler = $this->plugin('Organizations/GetOrganizationHandler'); |
127 | - $org = $handler->process($this->params(), true); |
|
127 | + $org = $handler->process($this->params(), true); |
|
128 | 128 | } catch (MissingParentOrganizationException $e) { |
129 | 129 | return $this->getErrorViewModel('no-parent'); |
130 | 130 | } catch (NotFoundException $e) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ]; |
136 | 136 | } |
137 | 137 | |
138 | - $container = $this->getFormular($org); |
|
138 | + $container = $this->getFormular($org); |
|
139 | 139 | |
140 | 140 | if (isset($formIdentifier) && $request->isPost()) { |
141 | 141 | /* @var $form \Zend\Form\FormInterface */ |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $form = $container->get($formIdentifier); |
161 | 161 | $form->setData(array_merge($postData, $filesData)); |
162 | 162 | if (!isset($form)) { |
163 | - throw new \RuntimeException('No form found for "' . $formIdentifier . '"'); |
|
163 | + throw new \RuntimeException('No form found for "'.$formIdentifier.'"'); |
|
164 | 164 | } |
165 | 165 | $isValid = $form->isValid(); |
166 | 166 |
@@ -169,6 +169,9 @@ |
||
169 | 169 | return new ViewModel($result); |
170 | 170 | } |
171 | 171 | |
172 | + /** |
|
173 | + * @param Organization $organization |
|
174 | + */ |
|
172 | 175 | private function disabledProfileViewModel($organization) |
173 | 176 | { |
174 | 177 | $model = new ViewModel([ |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function indexAction() |
80 | 80 | { |
81 | 81 | $result = $this->pagination([ |
82 | - 'params' => ['Organizations_Profile',[ |
|
82 | + 'params' => ['Organizations_Profile', [ |
|
83 | 83 | 'q', |
84 | 84 | 'count' => $this->options['count'], |
85 | 85 | 'page' => 1, |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $result = $this->pagination([ |
137 | 137 | 'params' => [ |
138 | - 'Organization_Jobs',[ |
|
138 | + 'Organization_Jobs', [ |
|
139 | 139 | 'q', |
140 | 140 | 'organization_id' => $id, |
141 | 141 | 'count' => $this->options['count'], |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | /* @var \Zend\Paginator\Paginator $paginator */ |
155 | 155 | $paginator = $result['jobs']; |
156 | 156 | $count = $paginator->getTotalItemCount(); |
157 | - if (0===$count) { |
|
157 | + if (0 === $count) { |
|
158 | 158 | return $this->disabledProfileViewModel($organization); |
159 | 159 | } |
160 | 160 | } |
@@ -32,7 +32,6 @@ |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | - * @param mixed $value$organizationImageEntity |
|
36 | 35 | * |
37 | 36 | * @return mixed |
38 | 37 | */ |
@@ -150,7 +150,7 @@ |
||
150 | 150 | * $this->proxy($method[, $arg1[, $arg2[, ...]]]); |
151 | 151 | * </pre> |
152 | 152 | * |
153 | - * @param $method |
|
153 | + * @param string $method |
|
154 | 154 | * |
155 | 155 | * @return self|mixed |
156 | 156 | */ |
@@ -195,7 +195,7 @@ |
||
195 | 195 | return $this->proxy('__isset', $property); |
196 | 196 | } |
197 | 197 | |
198 | - public function notEmpty($property, array $args=[]) |
|
198 | + public function notEmpty($property, array $args = []) |
|
199 | 199 | { |
200 | 200 | return $this->proxy('notEmpty', $args); |
201 | 201 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | /** |
38 | 38 | * Sets the label of the qualifications form field |
39 | 39 | * |
40 | - * @param string $labelQualification |
|
40 | + * @param string $labelQualifications |
|
41 | 41 | * |
42 | 42 | * @return self |
43 | 43 | */ |
@@ -87,7 +87,7 @@ |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * @param LifecycleEventArgs $eventArgs |
|
90 | + * @param PostFlushEventArgs $eventArgs |
|
91 | 91 | */ |
92 | 92 | public function postFlush(PostFlushEventArgs $eventArgs) |
93 | 93 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function getSubscribedEvents() |
50 | 50 | { |
51 | - if (! $this->manager->isEnabled()) { |
|
51 | + if (!$this->manager->isEnabled()) { |
|
52 | 52 | return []; |
53 | 53 | } |
54 | 54 | |
@@ -66,19 +66,19 @@ discard block |
||
66 | 66 | $organization = $eventArgs->getDocument(); |
67 | 67 | |
68 | 68 | // check for a organization instance |
69 | - if (! $organization instanceof Organization) { |
|
69 | + if (!$organization instanceof Organization) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | |
73 | 73 | // check if the image has been changed |
74 | - if (! $eventArgs->hasChangedField('image')) { |
|
74 | + if (!$eventArgs->hasChangedField('image')) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
78 | 78 | $image = $eventArgs->getOldValue('image'); |
79 | 79 | |
80 | 80 | // check if any image existed |
81 | - if (! $image instanceof OrganizationImage) { |
|
81 | + if (!$image instanceof OrganizationImage) { |
|
82 | 82 | return; |
83 | 83 | } |
84 | 84 |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | /** |
107 | 107 | * Finds the main organization of an user. |
108 | 108 | * |
109 | - * @param string|UserInterface $userOrId |
|
109 | + * @param string $userOrId |
|
110 | 110 | * |
111 | 111 | * @return null|OrganizationInterface |
112 | 112 | */ |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | /** |
143 | 143 | * Finds the organization, an user is employed by. |
144 | 144 | * |
145 | - * @param string|UserInterface $userOrId |
|
145 | + * @param string $userOrId |
|
146 | 146 | * |
147 | 147 | * @return null|OrganizationInterface |
148 | 148 | */ |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | /** |
271 | 271 | * Look for an drafted Document of a given user |
272 | 272 | * |
273 | - * @param $user |
|
273 | + * @param \Auth\Entity\AnonymousUser $user |
|
274 | 274 | * @return \Organizations\Entity\Organization|null |
275 | 275 | */ |
276 | 276 | public function findDraft($user) |
@@ -129,10 +129,10 @@ |
||
129 | 129 | // ) |
130 | 130 | // ); |
131 | 131 | $qb->addAnd($qb->expr()->field('user')->equals($userId)) |
132 | - ->addAnd( |
|
133 | - $qb->expr()->addOr($qb->expr()->field('parent')->exists(false)) |
|
134 | - ->addOr($qb->expr()->field('parent')->equals(null)) |
|
135 | - ); |
|
132 | + ->addAnd( |
|
133 | + $qb->expr()->addOr($qb->expr()->field('parent')->exists(false)) |
|
134 | + ->addOr($qb->expr()->field('parent')->equals(null)) |
|
135 | + ); |
|
136 | 136 | |
137 | 137 | $q = $qb->getQuery(); |
138 | 138 | $entity = $q->getSingleResult(); |
@@ -197,7 +197,7 @@ |
||
197 | 197 | * @param bool $persist |
198 | 198 | * @return \Organizations\Entity\Organization |
199 | 199 | */ |
200 | - public function create(array $data = null, $persist=false) |
|
200 | + public function create(array $data = null, $persist = false) |
|
201 | 201 | { |
202 | 202 | $entity = parent::create($data); |
203 | 203 | $entity->isDraft(true); |
@@ -14,6 +14,9 @@ |
||
14 | 14 | |
15 | 15 | class OrganizationName extends AbstractRepository |
16 | 16 | { |
17 | + /** |
|
18 | + * @param string $name |
|
19 | + */ |
|
17 | 20 | public function findbyName($name, $create = true) |
18 | 21 | { |
19 | 22 | $entity = $this->findOneBy(array('name' => $name)); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | /** |
165 | 165 | * give a summary of all inserted Files, |
166 | 166 | * this is for having access to those files in the post-process |
167 | - * @param \Core\View\Helper\InsertFile\FileEvent|\Zend\View\ViewEvent $e |
|
167 | + * @param FileEvent $e |
|
168 | 168 | * @return NULL |
169 | 169 | */ |
170 | 170 | public function collectFiles(FileEvent $e) |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | * |
314 | 314 | * @param string $name |
315 | 315 | * @param \Zend\View\Renderer\RendererInterface $renderer |
316 | - * @return string|boolean |
|
316 | + * @return string|false |
|
317 | 317 | */ |
318 | 318 | public function resolve($name, Renderer $renderer = null) |
319 | 319 | { |
@@ -40,10 +40,10 @@ |
||
40 | 40 | |
41 | 41 | |
42 | 42 | /** |
43 | - * Loads module specific configuration. |
|
44 | - * |
|
45 | - * @return array |
|
46 | - */ |
|
43 | + * Loads module specific configuration. |
|
44 | + * |
|
45 | + * @return array |
|
46 | + */ |
|
47 | 47 | public function getConfig() |
48 | 48 | { |
49 | 49 | return ModuleConfigLoader::load(__DIR__ . '/../config'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function getConfig() |
48 | 48 | { |
49 | - return ModuleConfigLoader::load(__DIR__ . '/../config'); |
|
49 | + return ModuleConfigLoader::load(__DIR__.'/../config'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public static function factory(ServiceManager $serviceManager) |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $eventManager->getSharedManager()->attach( |
63 | 63 | 'Applications', |
64 | 64 | 'application.detail.actionbuttons', |
65 | - function ($event) { |
|
65 | + function($event) { |
|
66 | 66 | return 'pdf/application/details/button'; |
67 | 67 | } |
68 | 68 | ); |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | { |
143 | 143 | $file = $e->getLastFileObject(); |
144 | 144 | // assume it is of the class Core\Entity\FileEntity |
145 | - $return = '<div class="col-md-3"><a href="#attachment_' . $file->getId() . '">' . $file->getName() . '</a></div>' . PHP_EOL |
|
146 | - . '<div class="col-md-3">' . $file->getType() . '</div>' |
|
147 | - . '<div class="col-md-3">' . $file->prettySize . '</div>'; |
|
145 | + $return = '<div class="col-md-3"><a href="#attachment_'.$file->getId().'">'.$file->getName().'</a></div>'.PHP_EOL |
|
146 | + . '<div class="col-md-3">'.$file->getType().'</div>' |
|
147 | + . '<div class="col-md-3">'.$file->prettySize.'</div>'; |
|
148 | 148 | /* |
149 | 149 | * this snippet was for direct inserting an image into the PDF |
150 | 150 | if ($file && $file instanceOf FileEntity && 0 === strpos($file->getType(), 'image')) { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | // the handles are for temporary files |
246 | 246 | error_reporting(0); |
247 | - foreach (array(self::RENDER_FULL, self::RENDER_WITHOUT_PDF, self::RENDER_WITHOUT_ATTACHMENTS ) as $render) { |
|
247 | + foreach (array(self::RENDER_FULL, self::RENDER_WITHOUT_PDF, self::RENDER_WITHOUT_ATTACHMENTS) as $render) { |
|
248 | 248 | $handles = array(); |
249 | 249 | try { |
250 | 250 | $pdf = new extern\mPDFderive(); |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | if (is_array($this->appendImage) && !empty($this->appendImage)) { |
259 | 259 | foreach ($this->appendImage as $imageAttachment) { |
260 | 260 | $content = $imageAttachment->getContent(); |
261 | - $url = 'data:image/' . $imageAttachment->getType() . ';base64,' . base64_encode($content); |
|
262 | - $html = '<a name="attachment_' . $imageAttachment->getId() . '"><img src="' . $url . '" /><br /></a>'; |
|
261 | + $url = 'data:image/'.$imageAttachment->getType().';base64,'.base64_encode($content); |
|
262 | + $html = '<a name="attachment_'.$imageAttachment->getId().'"><img src="'.$url.'" /><br /></a>'; |
|
263 | 263 | $pdf->WriteHTML($html); |
264 | 264 | } |
265 | 265 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $pagecount = $pdf->SetSourceFile($filename); |
287 | 287 | for ($pages = 0; $pages < $pagecount; $pages++) { |
288 | 288 | $pdf->AddPage(); |
289 | - $pdf->WriteHTML(' pages: ' . $pagecount); |
|
289 | + $pdf->WriteHTML(' pages: '.$pagecount); |
|
290 | 290 | $tx = $pdf->ImportPage($pages + 1); |
291 | 291 | $pdf->UseTemplate($tx); |
292 | 292 | } |
@@ -323,18 +323,18 @@ discard block |
||
323 | 323 | $defaultSuffix = $viewTemplatePathStack->getDefaultSuffix(); |
324 | 324 | if (pathinfo($name, PATHINFO_EXTENSION) != $defaultSuffix) { |
325 | 325 | ; |
326 | - $name .= '.pdf.' . $defaultSuffix; |
|
326 | + $name .= '.pdf.'.$defaultSuffix; |
|
327 | 327 | } else { |
328 | 328 | // TODO: replace Filename by Filename for PDF |
329 | 329 | } |
330 | 330 | |
331 | 331 | foreach ($paths as $path) { |
332 | - $file = new SplFileInfo($path . $name); |
|
332 | + $file = new SplFileInfo($path.$name); |
|
333 | 333 | if ($file->isReadable()) { |
334 | 334 | // Found! Return it. |
335 | 335 | if (($filePath = $file->getRealPath()) === false && substr($path, 0, 7) === 'phar://') { |
336 | 336 | // Do not try to expand phar paths (realpath + phars == fail) |
337 | - $filePath = $path . $name; |
|
337 | + $filePath = $path.$name; |
|
338 | 338 | if (!file_exists($filePath)) { |
339 | 339 | break; |
340 | 340 | } |