@@ -174,11 +174,11 @@ |
||
174 | 174 | return ''; |
175 | 175 | } |
176 | 176 | |
177 | - $token = $user instanceof AnonymousUser ? '?token=' . $user->getToken() : ''; |
|
177 | + $token = $user instanceof AnonymousUser ? '?token='.$user->getToken() : ''; |
|
178 | 178 | $href = $router->assemble( |
179 | 179 | ['id' => $this->application->getId()], |
180 | 180 | ['name'=>'lang/applications/detail', 'force_canonical'=>true] |
181 | - ) . $token; |
|
181 | + ).$token; |
|
182 | 182 | |
183 | 183 | return $href; |
184 | 184 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | 'link' => $this->router->assemble( |
101 | 101 | ['id' => $this->application->getId()], |
102 | 102 | ['name'=>'lang/applications/detail', 'force_canonical'=>true] |
103 | - ), |
|
103 | + ), |
|
104 | 104 | ]; |
105 | 105 | |
106 | 106 | $this->setTo($this->user->getInfo()->getEmail(), $this->user->getInfo()->getDisplayName(false)); |
@@ -121,7 +121,7 @@ |
||
121 | 121 | */ |
122 | 122 | public function setUser($user) |
123 | 123 | { |
124 | - $this->user=$user; |
|
124 | + $this->user = $user; |
|
125 | 125 | return $this; |
126 | 126 | } |
127 | 127 | } |
@@ -136,7 +136,7 @@ |
||
136 | 136 | * |
137 | 137 | * @return Forward |
138 | 138 | */ |
139 | - public static function factory(ContainerInterface $container, $requestedName, array $options=[]) |
|
139 | + public static function factory(ContainerInterface $container, $requestedName, array $options = []) |
|
140 | 140 | { |
141 | 141 | $ob = new self($options); |
142 | 142 | $ob->setContainer($container); |
@@ -85,7 +85,7 @@ |
||
85 | 85 | $application->getStatus(), |
86 | 86 | sprintf( |
87 | 87 | /* @translate */ 'Application was rated by %s', |
88 | - $this->auth()->getUser()->getInfo()->getDisplayName() |
|
88 | + $this->auth()->getUser()->getInfo()->getDisplayName() |
|
89 | 89 | ) |
90 | 90 | ); |
91 | 91 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $application->changeStatus( |
164 | 164 | $application->getStatus(), |
165 | 165 | sprintf(/*@translate*/ 'Application was read by %s', |
166 | - $this->auth()->getUser()->getInfo()->getDisplayName() |
|
166 | + $this->auth()->getUser()->getInfo()->getDisplayName() |
|
167 | 167 | ) |
168 | 168 | ); |
169 | 169 | } |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | $viewModel->setVariables( |
193 | 193 | /*array( |
194 | 194 | 'application' => */$this->builders |
195 | - ->get('JsonApplication') |
|
196 | - ->unbuild($application) |
|
195 | + ->get('JsonApplication') |
|
196 | + ->unbuild($application) |
|
197 | 197 | ); |
198 | 198 | $viewModel->setVariable('isUnread', $applicationIsUnread); |
199 | 199 | $return = $viewModel; |
@@ -358,12 +358,12 @@ discard block |
||
358 | 358 | /* @var ApplicationEvent $event */ |
359 | 359 | $event = $events->getEvent( |
360 | 360 | ApplicationEvent::EVENT_APPLICATION_STATUS_CHANGE, |
361 | - $this, |
|
362 | - [ |
|
363 | - 'application' => $application, |
|
364 | - 'status' => $status, |
|
365 | - 'user' => $this->auth()->getUser(), |
|
366 | - ] |
|
361 | + $this, |
|
362 | + [ |
|
363 | + 'application' => $application, |
|
364 | + 'status' => $status, |
|
365 | + 'user' => $this->auth()->getUser(), |
|
366 | + ] |
|
367 | 367 | ); |
368 | 368 | |
369 | 369 | $event->setIsPostRequest($request->isPost()); |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $emailAddress = $this->params()->fromQuery('email'); |
413 | 413 | /* @var \Applications\Entity\Application $application */ |
414 | 414 | $application = $this->repositories->get('Applications/Application') |
415 | - ->find($this->params('id')); |
|
415 | + ->find($this->params('id')); |
|
416 | 416 | |
417 | 417 | $this->acl($application, 'forward'); |
418 | 418 |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->appOptions = $appOptions; |
71 | 71 | $this->appEvents = $appEvents; |
72 | 72 | $this->translator = $translator; |
73 | - $this->container = $container; |
|
73 | + $this->container = $container; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | |
172 | 172 | |
173 | - $format=$this->params()->fromQuery('format'); |
|
173 | + $format = $this->params()->fromQuery('format'); |
|
174 | 174 | |
175 | 175 | if ($application->isDraft()) { |
176 | 176 | $list = false; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | && ($network = $this->params()->fromQuery('network')) |
299 | 299 | && ($data = $this->params()->fromPost('data')) |
300 | 300 | ) { |
301 | - $profileClass = '\\Auth\\Entity\\SocialProfiles\\' . $network; |
|
301 | + $profileClass = '\\Auth\\Entity\\SocialProfiles\\'.$network; |
|
302 | 302 | $profile = new $profileClass(); |
303 | 303 | $profile->setData(\Laminas\Json\Json::decode($data, \Laminas\Json\Json::TYPE_ARRAY)); |
304 | 304 | } else { |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | $this->acl($application, 'forward'); |
418 | 418 | |
419 | - $translator = $this->translator; |
|
419 | + $translator = $this->translator; |
|
420 | 420 | |
421 | 421 | if (!$emailAddress) { |
422 | 422 | throw new \InvalidArgumentException('An email address must be supplied.'); |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | public function deleteAction() |
457 | 457 | { |
458 | 458 | $id = $this->params('id'); |
459 | - $repositories= $this->repositories; |
|
459 | + $repositories = $this->repositories; |
|
460 | 460 | $repository = $repositories->get('Applications/Application'); |
461 | 461 | $application = $repository->find($id); |
462 | 462 | |
@@ -466,8 +466,8 @@ discard block |
||
466 | 466 | |
467 | 467 | $this->acl($application, 'delete'); |
468 | 468 | |
469 | - $events = $this->appEvents; |
|
470 | - $events->trigger(ApplicationEvent::EVENT_APPLICATION_PRE_DELETE, $this, [ 'application' => $application ]); |
|
469 | + $events = $this->appEvents; |
|
470 | + $events->trigger(ApplicationEvent::EVENT_APPLICATION_PRE_DELETE, $this, ['application' => $application]); |
|
471 | 471 | |
472 | 472 | $repositories->remove($application); |
473 | 473 |
@@ -137,8 +137,8 @@ |
||
137 | 137 | $application->changeStatus( |
138 | 138 | Status::REJECTED, |
139 | 139 | sprintf( |
140 | - /*@translate */ 'Mail was sent to %s', |
|
141 | - $application->contact->email |
|
140 | + /*@translate */ 'Mail was sent to %s', |
|
141 | + $application->contact->email |
|
142 | 142 | ) |
143 | 143 | ); |
144 | 144 | $repositoryService->store($application); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $hidden = ''; |
71 | 71 | $displayNames = array(); |
72 | 72 | foreach ($elements as $element) { |
73 | - $hidden .= '<input type="hidden" name="elements[]" value="' . $element . '">'; |
|
73 | + $hidden .= '<input type="hidden" name="elements[]" value="'.$element.'">'; |
|
74 | 74 | $application = $repository->find($element); |
75 | 75 | $isAllowed = $this->acl()->test($application, 'change'); |
76 | 76 | if ($isAllowed) { |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | array( |
90 | 90 | 'ok' => true, |
91 | 91 | 'header' => $translator->translate('reject the applicants'), |
92 | - 'content' => '<form action="' . $actionUrl . '">' . |
|
93 | - $hidden . |
|
92 | + 'content' => '<form action="'.$actionUrl.'">'. |
|
93 | + $hidden. |
|
94 | 94 | '<input class=" form-control " name="mail-subject" value="' |
95 | - . $mailSubject . '"><br /><br />' . |
|
95 | + . $mailSubject.'"><br /><br />'. |
|
96 | 96 | '<textarea class=" form-control " id="mail-content" name="mail-content">' |
97 | - . $mailText . '</textarea></form>' |
|
97 | + . $mailText.'</textarea></form>' |
|
98 | 98 | ) |
99 | 99 | ); |
100 | 100 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $repositoryService->store($application); |
143 | 143 | unset($mail); |
144 | 144 | } |
145 | - return new JsonModel(array('ok' => true, )); |
|
145 | + return new JsonModel(array('ok' => true,)); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function moveAction() |
154 | 154 | { |
155 | - $ids = (array)$this->params()->fromPost('ids'); |
|
155 | + $ids = (array) $this->params()->fromPost('ids'); |
|
156 | 156 | $moved = 0; |
157 | 157 | |
158 | 158 | if ($ids) { |
@@ -40,10 +40,10 @@ |
||
40 | 40 | |
41 | 41 | //default sorting |
42 | 42 | if (!isset($params['sort'])) { |
43 | - $params['sort']="-date"; |
|
43 | + $params['sort'] = "-date"; |
|
44 | 44 | } |
45 | 45 | $params->count = 5; |
46 | - $params->pageRange=5; |
|
46 | + $params->pageRange = 5; |
|
47 | 47 | |
48 | 48 | $this->paginationParams()->setParams('Applications\Index', $params); |
49 | 49 |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $table = new Table( |
159 | 159 | array('columnWidths' => array(40, 40, 40), |
160 | - 'decorator' => 'ascii') |
|
160 | + 'decorator' => 'ascii') |
|
161 | 161 | ); |
162 | 162 | |
163 | 163 | $table->appendRow(array('Module', 'Name', 'Description')); |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | $attachments = $app->getAttachments(); |
239 | 239 | foreach ($attachments as $attachment) { |
240 | 240 | $attachment->getPermissions() |
241 | - ->clear() |
|
242 | - ->inherit($permissions); |
|
241 | + ->clear() |
|
242 | + ->inherit($permissions); |
|
243 | 243 | } |
244 | 244 | $contact = $app->getContact(); |
245 | 245 | if ($contact) { |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | |
248 | 248 | if ($image) { |
249 | 249 | $image->getPermissions() |
250 | - ->clear() |
|
251 | - ->inherit($permissions); |
|
250 | + ->clear() |
|
251 | + ->inherit($permissions); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | echo "Generate keywords for $count applications ...\n"; |
99 | 99 | |
100 | - $progress = new ProgressBar($count); |
|
100 | + $progress = new ProgressBar($count); |
|
101 | 101 | |
102 | 102 | /** @var \Core\Repository\Filter\PropertyToKeywords $filter */ |
103 | 103 | $filter = $this->filterManager->get('Core/Repository/PropertyToKeywords'); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | /** @var \Applications\Entity\Application $application */ |
107 | 107 | foreach ($applications as $application) { |
108 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
108 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
109 | 109 | $keywords = $filter->filter($application); |
110 | 110 | |
111 | 111 | $application->setKeywords($keywords); |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | { |
132 | 132 | $applications = $this->fetchApplications(); |
133 | 133 | $count = count($applications); |
134 | - $i=0; |
|
135 | - echo "Calculate rating for " . $count . " applications ...\n"; |
|
134 | + $i = 0; |
|
135 | + echo "Calculate rating for ".$count." applications ...\n"; |
|
136 | 136 | |
137 | 137 | $progress = new ProgressBar($count); |
138 | 138 | /** @var \Applications\Entity\Application $application */ |
139 | 139 | foreach ($applications as $application) { |
140 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
140 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
141 | 141 | $application->getRating(/* recalculate */ true); |
142 | 142 | } |
143 | 143 | $progress->update($i, 'Write to database...'); |
@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | $documentManager = $this->documentManager; |
165 | 165 | |
166 | 166 | $count = count($applications); |
167 | - $i=0; |
|
167 | + $i = 0; |
|
168 | 168 | |
169 | - echo $count . " applications in Draft Mode and older than " . $days . " days will be deleted\n"; |
|
169 | + echo $count." applications in Draft Mode and older than ".$days." days will be deleted\n"; |
|
170 | 170 | |
171 | 171 | $progress = new ProgressBar($count); |
172 | 172 | |
173 | 173 | foreach ($applications as $application) { |
174 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
174 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
175 | 175 | try { |
176 | 176 | $documentManager->remove($application); |
177 | 177 | } catch (\Exception $e) { |
@@ -198,17 +198,17 @@ discard block |
||
198 | 198 | |
199 | 199 | $table->appendRow(array('Module', 'Name', 'Description')); |
200 | 200 | |
201 | - $offset=strlen(getcwd())+1; |
|
202 | - $links=""; |
|
203 | - $github='https://github.com/cross-solution/YAWIK/blob/master/'; |
|
201 | + $offset = strlen(getcwd()) + 1; |
|
202 | + $links = ""; |
|
203 | + $github = 'https://github.com/cross-solution/YAWIK/blob/master/'; |
|
204 | 204 | |
205 | 205 | foreach ($config['view_manager']['template_map'] as $key => $absolute_filename) { |
206 | 206 | // strip the application_root plus an additional slash |
207 | - $filename=substr(realpath($absolute_filename), $offset); |
|
207 | + $filename = substr(realpath($absolute_filename), $offset); |
|
208 | 208 | if (preg_match('~module/([^/]+)~', $filename, $match)) { |
209 | - $module=$match[1]; |
|
209 | + $module = $match[1]; |
|
210 | 210 | } else { |
211 | - $module="not found ($key)"; |
|
211 | + $module = "not found ($key)"; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | $viewModel = new ViewModel(); |
@@ -217,17 +217,17 @@ discard block |
||
217 | 217 | $row = new Row(); |
218 | 218 | $row->appendColumn(new Column($module)); |
219 | 219 | if ($filename) { |
220 | - $row->appendColumn(new Column('`' . $key . '`_')); |
|
221 | - $links.='.. _'. $key .': '. $github.$filename .PHP_EOL; |
|
220 | + $row->appendColumn(new Column('`'.$key.'`_')); |
|
221 | + $links .= '.. _'.$key.': '.$github.$filename.PHP_EOL; |
|
222 | 222 | } else { |
223 | 223 | $row->appendColumn(new Column("WRONG CONFIGURATION")); |
224 | 224 | } |
225 | - $comment=""; |
|
225 | + $comment = ""; |
|
226 | 226 | if (file_exists($absolute_filename)) { |
227 | - $src=file_get_contents($absolute_filename); |
|
228 | - $comment="file exists"; |
|
227 | + $src = file_get_contents($absolute_filename); |
|
228 | + $comment = "file exists"; |
|
229 | 229 | if (preg_match("/{{rtd:\s*(.*)}}/", $src, $match)) { |
230 | - $comment=$match['1']; |
|
230 | + $comment = $match['1']; |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | $row->appendColumn(new Column($comment)); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | echo "Loading applications... "; |
246 | 246 | |
247 | - $filter = \Laminas\Json\Json::decode($this->params('filter', '{}'), \Laminas\Json\Json::TYPE_ARRAY); |
|
247 | + $filter = \Laminas\Json\Json::decode($this->params('filter', '{}'), \Laminas\Json\Json::TYPE_ARRAY); |
|
248 | 248 | $filter['$or'] = array( |
249 | 249 | array('attachments' => array('$exists' => 1)), |
250 | 250 | array('contact.image' => array('$exists' => 1)), |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | return; |
259 | 259 | } |
260 | 260 | $progress = new ProgressBar($count); |
261 | - $i=0; |
|
261 | + $i = 0; |
|
262 | 262 | |
263 | 263 | foreach ($applications as $app) { |
264 | 264 | $progress->update($i++, "Process $i / $count"); |
@@ -26,11 +26,11 @@ |
||
26 | 26 | // 'driver' => 'odm_default', |
27 | 27 | // |
28 | 28 | // 'generate_proxies' => true, |
29 | - 'proxy_dir' => getcwd().'/var/cache/DoctrineMongoODMModule/Proxy', |
|
29 | + 'proxy_dir' => getcwd().'/var/cache/DoctrineMongoODMModule/Proxy', |
|
30 | 30 | // 'proxy_namespace' => 'DoctrineMongoODMModule\Proxy', |
31 | 31 | // |
32 | 32 | // 'generate_hydrators' => true, |
33 | - 'hydrator_dir' => getcwd().'/var/cache/DoctrineMongoODMModule/Hydrator', |
|
33 | + 'hydrator_dir' => getcwd().'/var/cache/DoctrineMongoODMModule/Hydrator', |
|
34 | 34 | // 'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator', |
35 | 35 | // |
36 | 36 | // 'default_db' => '', |