@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | echo "Generate keywords for $count applications ...\n"; |
65 | 65 | |
66 | - $progress = new ProgressBar($count); |
|
66 | + $progress = new ProgressBar($count); |
|
67 | 67 | |
68 | 68 | /** @var PropertyToKeywords $filter */ |
69 | 69 | $filter = $services->get('filtermanager')->get('Core/Repository/PropertyToKeywords'); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | /** @var \Applications\Entity\Application $application */ |
73 | 73 | foreach ($applications as $application) { |
74 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
74 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
75 | 75 | $keywords = $filter->filter($application); |
76 | 76 | |
77 | 77 | $application->setKeywords($keywords); |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | { |
98 | 98 | $applications = $this->fetchApplications(); |
99 | 99 | $count = count($applications); |
100 | - $i=0; |
|
101 | - echo "Calculate rating for " . $count . " applications ...\n"; |
|
100 | + $i = 0; |
|
101 | + echo "Calculate rating for ".$count." applications ...\n"; |
|
102 | 102 | |
103 | 103 | $progress = new ProgressBar($count); |
104 | 104 | /** @var \Applications\Entity\Application $application */ |
105 | 105 | foreach ($applications as $application) { |
106 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
106 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
107 | 107 | $application->getRating(/* recalculate */ true); |
108 | 108 | } |
109 | 109 | $progress->update($i, 'Write to database...'); |
@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | $documentManager = $services->get('Core/DocumentManager'); |
132 | 132 | |
133 | 133 | $count = count($applications); |
134 | - $i=0; |
|
134 | + $i = 0; |
|
135 | 135 | |
136 | - echo $count . " applications in Draft Mode and older than " . $days . " days will be deleted\n"; |
|
136 | + echo $count." applications in Draft Mode and older than ".$days." days will be deleted\n"; |
|
137 | 137 | |
138 | 138 | $progress = new ProgressBar($count); |
139 | 139 | |
140 | 140 | foreach ($applications as $application) { |
141 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
141 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
142 | 142 | $documentManager->remove($application); |
143 | 143 | } |
144 | 144 | $progress->update($i, 'clean up database'); |
@@ -160,17 +160,17 @@ discard block |
||
160 | 160 | |
161 | 161 | $table->appendRow(array('Module', 'Name', 'Description')); |
162 | 162 | |
163 | - $offset=strlen(getcwd())+1; |
|
164 | - $links=""; |
|
165 | - $github='https://github.com/cross-solution/YAWIK/blob/master/'; |
|
163 | + $offset = strlen(getcwd()) + 1; |
|
164 | + $links = ""; |
|
165 | + $github = 'https://github.com/cross-solution/YAWIK/blob/master/'; |
|
166 | 166 | |
167 | 167 | foreach ($config['view_manager']['template_map'] as $key => $absolute_filename) { |
168 | 168 | // strip the application_root plus an additional slash |
169 | - $filename=substr(realpath($absolute_filename), $offset); |
|
169 | + $filename = substr(realpath($absolute_filename), $offset); |
|
170 | 170 | if (preg_match('~module/([^/]+)~', $filename, $match)) { |
171 | - $module=$match[1]; |
|
171 | + $module = $match[1]; |
|
172 | 172 | } else { |
173 | - $module="not found ($key)"; |
|
173 | + $module = "not found ($key)"; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | $viewModel = new ViewModel(); |
@@ -179,17 +179,17 @@ discard block |
||
179 | 179 | $row = new Row(); |
180 | 180 | $row->appendColumn(new Column($module)); |
181 | 181 | if ($filename) { |
182 | - $row->appendColumn(new Column('`' . $key . '`_')); |
|
183 | - $links.='.. _'. $key .': '. $github.$filename .PHP_EOL; |
|
182 | + $row->appendColumn(new Column('`'.$key.'`_')); |
|
183 | + $links .= '.. _'.$key.': '.$github.$filename.PHP_EOL; |
|
184 | 184 | } else { |
185 | 185 | $row->appendColumn(new Column("WRONG CONFIGURATION")); |
186 | 186 | } |
187 | - $comment=""; |
|
187 | + $comment = ""; |
|
188 | 188 | if (file_exists($absolute_filename)) { |
189 | - $src=file_get_contents($absolute_filename); |
|
190 | - $comment="file exists"; |
|
189 | + $src = file_get_contents($absolute_filename); |
|
190 | + $comment = "file exists"; |
|
191 | 191 | if (preg_match("/{{rtd:\s*(.*)}}/", $src, $match)) { |
192 | - $comment=$match['1']; |
|
192 | + $comment = $match['1']; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | $row->appendColumn(new Column($comment)); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | { |
207 | 207 | echo "Loading applications... "; |
208 | 208 | |
209 | - $filter = \Zend\Json\Json::decode($this->params('filter', '{}'), \Zend\Json\Json::TYPE_ARRAY); |
|
209 | + $filter = \Zend\Json\Json::decode($this->params('filter', '{}'), \Zend\Json\Json::TYPE_ARRAY); |
|
210 | 210 | $filter['$or'] = array( |
211 | 211 | array('attachments' => array('$exists' => 1)), |
212 | 212 | array('contact.image' => array('$exists' => 1)), |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | return; |
221 | 221 | } |
222 | 222 | $progress = new ProgressBar($count); |
223 | - $i=0; |
|
223 | + $i = 0; |
|
224 | 224 | |
225 | 225 | foreach ($applications as $app) { |
226 | 226 | $progress->update($i++, "Process $i / $count"); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $hidden = ''; |
73 | 73 | $displayNames = array(); |
74 | 74 | foreach ($elements as $element) { |
75 | - $hidden .= '<input type="hidden" name="elements[]" value="' . $element . '">'; |
|
75 | + $hidden .= '<input type="hidden" name="elements[]" value="'.$element.'">'; |
|
76 | 76 | $application = $repository->find($element); |
77 | 77 | $isAllowed = $this->acl()->test($application, 'change'); |
78 | 78 | if ($isAllowed) { |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | array( |
92 | 92 | 'ok' => true, |
93 | 93 | 'header' => $translator->translate('reject the applicants'), |
94 | - 'content' => '<form action="' . $actionUrl . '">' . |
|
95 | - $hidden . |
|
94 | + 'content' => '<form action="'.$actionUrl.'">'. |
|
95 | + $hidden. |
|
96 | 96 | '<input class=" form-control " name="mail-subject" value="' |
97 | - . $mailSubject . '"><br /><br />' . |
|
97 | + . $mailSubject.'"><br /><br />'. |
|
98 | 98 | '<textarea class=" form-control " id="mail-content" name="mail-content">' |
99 | - . $mailText . '</textarea></form>' |
|
99 | + . $mailText.'</textarea></form>' |
|
100 | 100 | ) |
101 | 101 | ); |
102 | 102 | } |
@@ -144,6 +144,6 @@ discard block |
||
144 | 144 | $repositoryService->store($application); |
145 | 145 | unset($mail); |
146 | 146 | } |
147 | - return new JsonModel(array('ok' => true, )); |
|
147 | + return new JsonModel(array('ok' => true,)); |
|
148 | 148 | } |
149 | 149 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function getConfig() |
51 | 51 | { |
52 | - return ModuleConfigLoader::load(__DIR__ . '/config'); |
|
52 | + return ModuleConfigLoader::load(__DIR__.'/config'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | return array( |
63 | 63 | 'Zend\Loader\StandardAutoloader' => array( |
64 | 64 | 'namespaces' => array( |
65 | - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
66 | - __NAMESPACE__ . 'Test' => __DIR__ . '/test/' . __NAMESPACE__ .'Test', |
|
65 | + __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__, |
|
66 | + __NAMESPACE__.'Test' => __DIR__.'/test/'.__NAMESPACE__.'Test', |
|
67 | 67 | ), |
68 | 68 | ), |
69 | 69 | ); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | ), |
9 | 9 | 'view_manager' => array( |
10 | 10 | 'template_map' => array( |
11 | - 'pdf/application/details/button' => __DIR__ . '/../view/applicationDetailsButton.phtml', |
|
11 | + 'pdf/application/details/button' => __DIR__.'/../view/applicationDetailsButton.phtml', |
|
12 | 12 | ) |
13 | 13 | ), |
14 | 14 | ); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function getConfig() |
51 | 51 | { |
52 | - return ModuleConfigLoader::load(__DIR__ . '/config'); |
|
52 | + return ModuleConfigLoader::load(__DIR__.'/config'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function setServiceManager(ServiceManager $serviceManager) |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $eventManager->getSharedManager()->attach( |
65 | 65 | 'Applications', |
66 | 66 | 'application.detail.actionbuttons', |
67 | - function ($event) { |
|
67 | + function($event) { |
|
68 | 68 | return 'pdf/application/details/button'; |
69 | 69 | } |
70 | 70 | ); |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | { |
145 | 145 | $file = $e->getLastFileObject(); |
146 | 146 | // assume it is of the class Core\Entity\FileEntity |
147 | - $return = '<div class="col-md-3"><a href="#attachment_' . $file->getId() . '">' . $file->getName() . '</a></div>' . PHP_EOL |
|
148 | - . '<div class="col-md-3">' . $file->getType() . '</div>' |
|
149 | - . '<div class="col-md-3">' . $file->prettySize . '</div>'; |
|
147 | + $return = '<div class="col-md-3"><a href="#attachment_'.$file->getId().'">'.$file->getName().'</a></div>'.PHP_EOL |
|
148 | + . '<div class="col-md-3">'.$file->getType().'</div>' |
|
149 | + . '<div class="col-md-3">'.$file->prettySize.'</div>'; |
|
150 | 150 | /* |
151 | 151 | * this snippet was for direct inserting an image into the PDF |
152 | 152 | if ($file && $file instanceOf FileEntity && 0 === strpos($file->getType(), 'image')) { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | // the handles are for temporary files |
248 | 248 | error_reporting(0); |
249 | - foreach (array(self::RENDER_FULL, self::RENDER_WITHOUT_PDF, self::RENDER_WITHOUT_ATTACHMENTS ) as $render) { |
|
249 | + foreach (array(self::RENDER_FULL, self::RENDER_WITHOUT_PDF, self::RENDER_WITHOUT_ATTACHMENTS) as $render) { |
|
250 | 250 | $handles = array(); |
251 | 251 | try { |
252 | 252 | $pdf = new extern\mPDFderive(); |
@@ -260,8 +260,8 @@ discard block |
||
260 | 260 | if (is_array($this->appendImage) && !empty($this->appendImage)) { |
261 | 261 | foreach ($this->appendImage as $imageAttachment) { |
262 | 262 | $content = $imageAttachment->getContent(); |
263 | - $url = 'data:image/' . $imageAttachment->getType() . ';base64,' . base64_encode($content); |
|
264 | - $html = '<a name="attachment_' . $imageAttachment->getId() . '"><img src="' . $url . '" /><br /></a>'; |
|
263 | + $url = 'data:image/'.$imageAttachment->getType().';base64,'.base64_encode($content); |
|
264 | + $html = '<a name="attachment_'.$imageAttachment->getId().'"><img src="'.$url.'" /><br /></a>'; |
|
265 | 265 | $pdf->WriteHTML($html); |
266 | 266 | } |
267 | 267 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $pagecount = $pdf->SetSourceFile($filename); |
289 | 289 | for ($pages = 0; $pages < $pagecount; $pages++) { |
290 | 290 | $pdf->AddPage(); |
291 | - $pdf->WriteHTML(' pages: ' . $pagecount); |
|
291 | + $pdf->WriteHTML(' pages: '.$pagecount); |
|
292 | 292 | $tx = $pdf->ImportPage($pages + 1); |
293 | 293 | $pdf->UseTemplate($tx); |
294 | 294 | } |
@@ -325,18 +325,18 @@ discard block |
||
325 | 325 | $defaultSuffix = $viewTemplatePathStack->getDefaultSuffix(); |
326 | 326 | if (pathinfo($name, PATHINFO_EXTENSION) != $defaultSuffix) { |
327 | 327 | ; |
328 | - $name .= '.pdf.' . $defaultSuffix; |
|
328 | + $name .= '.pdf.'.$defaultSuffix; |
|
329 | 329 | } else { |
330 | 330 | // TODO: replace Filename by Filename for PDF |
331 | 331 | } |
332 | 332 | |
333 | 333 | foreach ($paths as $path) { |
334 | - $file = new SplFileInfo($path . $name); |
|
334 | + $file = new SplFileInfo($path.$name); |
|
335 | 335 | if ($file->isReadable()) { |
336 | 336 | // Found! Return it. |
337 | 337 | if (($filePath = $file->getRealPath()) === false && substr($path, 0, 7) === 'phar://') { |
338 | 338 | // Do not try to expand phar paths (realpath + phars == fail) |
339 | - $filePath = $path . $name; |
|
339 | + $filePath = $path.$name; |
|
340 | 340 | if (!file_exists($filePath)) { |
341 | 341 | break; |
342 | 342 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'translation_file_patterns' => array( |
38 | 38 | array( |
39 | 39 | 'type' => 'gettext', |
40 | - 'base_dir' => __DIR__ . '/../language', |
|
40 | + 'base_dir' => __DIR__.'/../language', |
|
41 | 41 | 'pattern' => '%s.mo', |
42 | 42 | ), |
43 | 43 | ), |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // Where to look for view templates not mapped above |
102 | 102 | 'template_path_stack' => array( |
103 | - __DIR__ . '/../view', |
|
103 | + __DIR__.'/../view', |
|
104 | 104 | ), |
105 | 105 | ), |
106 | 106 |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function __get($property) |
140 | 140 | { |
141 | - $getter = "get" . ucfirst($property); |
|
141 | + $getter = "get".ucfirst($property); |
|
142 | 142 | if (method_exists($this, $getter)) { |
143 | 143 | return $this->$getter(); |
144 | 144 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | $this->checkWriteAccess(); |
161 | 161 | |
162 | - $setter = 'set' . ucfirst($property); |
|
162 | + $setter = 'set'.ucfirst($property); |
|
163 | 163 | if (method_exists($this, $setter)) { |
164 | 164 | $this->$setter($value); |
165 | 165 | return; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | parent::__construct(); |
24 | 24 | $this->addFilter( |
25 | 25 | 'ignoreInternalProperties', |
26 | - function ($property) { |
|
26 | + function($property) { |
|
27 | 27 | return "_" != $property{0}; |
28 | 28 | } |
29 | 29 | ); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | if (!$this->filterComposite->filter($propertyName)) { |
44 | 44 | continue; |
45 | 45 | } |
46 | - $getter = 'get' . ucfirst($propertyName); |
|
46 | + $getter = 'get'.ucfirst($propertyName); |
|
47 | 47 | $value = method_exists($object, $getter) |
48 | 48 | ? $object->$getter() |
49 | 49 | : $property->getValue($object); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | foreach ($data as $key => $value) { |
66 | 66 | if (isset($reflProperties[$key])) { |
67 | 67 | $value = $this->hydrateValue($key, $value); |
68 | - $setter = 'set' . ucfirst($key); |
|
68 | + $setter = 'set'.ucfirst($key); |
|
69 | 69 | if (method_exists($object, $setter)) { |
70 | 70 | $object->$setter($value); |
71 | 71 | } else { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $headscript->appendFile($basepath('Settings/js/forms.decfs.js')); |
38 | 38 | |
39 | - return '<ul class="disable-elements-list" id="' . $element->getAttribute('id') . '-list"' . '>' |
|
39 | + return '<ul class="disable-elements-list" id="'.$element->getAttribute('id').'-list"'.'>' |
|
40 | 40 | . $this->renderCheckboxes($element->getCheckboxes()) |
41 | 41 | . '</ul>'; |
42 | 42 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | unset($boxes['__all__']); |
61 | 61 | } |
62 | 62 | |
63 | - $markup .= '<ul class="disable-elements">' . $this->renderCheckboxes($boxes) . '</ul>'; |
|
63 | + $markup .= '<ul class="disable-elements">'.$this->renderCheckboxes($boxes).'</ul>'; |
|
64 | 64 | } else { |
65 | 65 | $markup .= $this->renderCheckbox($boxes); |
66 | 66 | } |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | /* @var $renderer \Zend\View\Renderer\PhpRenderer */ |
83 | 83 | $renderer = $this->getView(); |
84 | 84 | if (null !== $class) { |
85 | - $box->setAttribute('class', $box->getAttribute('class') . ' ' . $class); |
|
85 | + $box->setAttribute('class', $box->getAttribute('class').' '.$class); |
|
86 | 86 | } |
87 | 87 | $markup = $renderer->formCheckbox($box); |
88 | 88 | if ($desc = $box->getOption('description')) { |
89 | 89 | $desc = $this->getTranslator()->translate($desc, $this->getTranslatorTextDomain()); |
90 | - $markup .= '<div class="alert alert-info"><p>' . $desc . '</p></div>'; |
|
90 | + $markup .= '<div class="alert alert-info"><p>'.$desc.'</p></div>'; |
|
91 | 91 | } |
92 | 92 | return $markup; |
93 | 93 | } |