@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * - injects the MvcEvent instance |
| 27 | 27 | * |
| 28 | 28 | * @param ServiceLocatorInterface $serviceLocator |
| 29 | - * @return \Core\View\Helper\Params |
|
| 29 | + * @return DateFormat |
|
| 30 | 30 | * @see \Zend\ServiceManager\FactoryInterface::createService() |
| 31 | 31 | */ |
| 32 | 32 | public function createService(ServiceLocatorInterface $serviceLocator) |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | * Sets the job entity |
| 65 | 65 | * |
| 66 | 66 | * @param Job $jobEntity |
| 67 | - * @return MvcEvent |
|
| 67 | + * @return JobEvent |
|
| 68 | 68 | */ |
| 69 | 69 | public function setJobEntity(Job $jobEntity) |
| 70 | 70 | { |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | * Event is fired when a users has created a new job opening and accepted the |
| 35 | 35 | * terms and conditions |
| 36 | 36 | */ |
| 37 | - const EVENT_JOB_CREATED = 'job.created'; |
|
| 37 | + const EVENT_JOB_CREATED = 'job.created'; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Event is fired when the owner of the YAWIK installation has accepted the job |
| 41 | 41 | * opening |
| 42 | 42 | */ |
| 43 | - const EVENT_JOB_ACCEPTED = 'job.accepted'; |
|
| 43 | + const EVENT_JOB_ACCEPTED = 'job.accepted'; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Event is fired, when the owner of the YAWIK installation has rejected the job |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * get all available names for publishing |
| 56 | 56 | */ |
| 57 | - const PORTAL_AVAIL_NAME = 'portal.availname'; |
|
| 57 | + const PORTAL_AVAIL_NAME = 'portal.availname'; |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * @var portals to be published |
@@ -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 | } |
@@ -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 | { |
@@ -39,11 +39,11 @@ |
||
| 39 | 39 | protected $appendImage = array(); |
| 40 | 40 | |
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Loads module specific configuration. |
|
| 44 | - * |
|
| 45 | - * @return array |
|
| 46 | - */ |
|
| 42 | + /** |
|
| 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 | } |
@@ -44,7 +44,6 @@ |
||
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * the $id for an entity 'setting' is the same as for the entity 'user' |
| 47 | - * @param type $id |
|
| 48 | 47 | */ |
| 49 | 48 | public function getSettingsByUser($user) |
| 50 | 49 | { |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | if (strpos($addModule, '-') === 0) { |
| 41 | 41 | $remove = substr($addModule,1); |
| 42 | 42 | $modules = array_filter($modules, function ($elem) use ($remove) { return strcasecmp($elem,$remove); }); |
| 43 | - } |
|
| 44 | - else { |
|
| 43 | + } else { |
|
| 45 | 44 | if (!in_array($addModule, $modules)) { |
| 46 | 45 | $modules[] = $addModule; |
| 47 | 46 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | $env = getenv('APPLICATION_ENV') ?: 'production'; |
| 14 | 14 | |
| 15 | -if (!file_exists(__DIR__ . '/autoload/yawik.config.global.php')) { |
|
| 15 | +if (!file_exists(__DIR__.'/autoload/yawik.config.global.php')) { |
|
| 16 | 16 | $modules = array('Install'); |
| 17 | 17 | } else { |
| 18 | 18 | $modules = array( |
@@ -34,12 +34,12 @@ discard block |
||
| 34 | 34 | // kann und über Server-Variablen oder ähnlichen steuern kann |
| 35 | 35 | $allModules = False; |
| 36 | 36 | } |
| 37 | - foreach (glob(__DIR__ . '/autoload/*.module.php') as $moduleFile) { |
|
| 37 | + foreach (glob(__DIR__.'/autoload/*.module.php') as $moduleFile) { |
|
| 38 | 38 | $addModules = require $moduleFile; |
| 39 | 39 | foreach ($addModules as $addModule) { |
| 40 | 40 | if (strpos($addModule, '-') === 0) { |
| 41 | - $remove = substr($addModule,1); |
|
| 42 | - $modules = array_filter($modules, function ($elem) use ($remove) { return strcasecmp($elem,$remove); }); |
|
| 41 | + $remove = substr($addModule, 1); |
|
| 42 | + $modules = array_filter($modules, function($elem) use ($remove) { return strcasecmp($elem, $remove); }); |
|
| 43 | 43 | } |
| 44 | 44 | else { |
| 45 | 45 | if (!in_array($addModule, $modules)) { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ), |
| 93 | 93 | ); |
| 94 | 94 | |
| 95 | -$envConfigFile = __DIR__ . '/config.' . $env . '.php'; |
|
| 95 | +$envConfigFile = __DIR__.'/config.'.$env.'.php'; |
|
| 96 | 96 | if (file_exists($envConfigFile)) { |
| 97 | 97 | if (is_readable($envConfigFile)) { |
| 98 | 98 | $envConfig = include $envConfigFile; |
@@ -35,10 +35,10 @@ |
||
| 35 | 35 | 'applications list' => 'list view scripts.', |
| 36 | 36 | 'applications reset-files-permissions [--filter=]' => 'Resets (means: Set again) the permissions of attachments and contact images', |
| 37 | 37 | array('--filter=JSON', "available keys:\n" |
| 38 | - . "- before ISODate only applications before the given date\n" |
|
| 39 | - . "- after ISODate only applications after the given date\n" |
|
| 40 | - . "- id String Mongo ID of the application\n" |
|
| 41 | - . "- isDraft Boolean "), |
|
| 38 | + . "- before ISODate only applications before the given date\n" |
|
| 39 | + . "- after ISODate only applications after the given date\n" |
|
| 40 | + . "- id String Mongo ID of the application\n" |
|
| 41 | + . "- isDraft Boolean "), |
|
| 42 | 42 | ); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -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 | ); |
@@ -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 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | echo "Generate keywords for $count applications ...\n"; |
| 63 | 63 | |
| 64 | - $progress = new ProgressBar($count); |
|
| 64 | + $progress = new ProgressBar($count); |
|
| 65 | 65 | |
| 66 | 66 | /** @var \Core\Repository\Filter\PropertyToKeywords $filter */ |
| 67 | 67 | $filter = $services->get('filtermanager')->get('Core/Repository/PropertyToKeywords'); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | /** @var \Applications\Entity\Application $application */ |
| 71 | 71 | foreach ($applications as $application) { |
| 72 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
| 72 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
| 73 | 73 | $keywords = $filter->filter($application); |
| 74 | 74 | |
| 75 | 75 | $application->setKeywords($keywords); |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $applications = $this->fetchApplications(); |
| 97 | 97 | $count = count($applications); |
| 98 | - $i=0; |
|
| 99 | - echo "Calculate rating for " . $count . " applications ...\n"; |
|
| 98 | + $i = 0; |
|
| 99 | + echo "Calculate rating for ".$count." applications ...\n"; |
|
| 100 | 100 | |
| 101 | 101 | $progress = new ProgressBar($count); |
| 102 | 102 | /** @var \Applications\Entity\Application $application */ |
| 103 | 103 | foreach ($applications as $application) { |
| 104 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
| 104 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
| 105 | 105 | $application->getRating(/* recalculate */ true); |
| 106 | 106 | } |
| 107 | 107 | $progress->update($i, 'Write to database...'); |
@@ -129,17 +129,17 @@ discard block |
||
| 129 | 129 | $documentManager = $services->get('Core/DocumentManager'); |
| 130 | 130 | |
| 131 | 131 | $count = count($applications); |
| 132 | - $i=0; |
|
| 132 | + $i = 0; |
|
| 133 | 133 | |
| 134 | - echo $count . " applications in Draft Mode and older than " . $days . " days will be deleted\n"; |
|
| 134 | + echo $count." applications in Draft Mode and older than ".$days." days will be deleted\n"; |
|
| 135 | 135 | |
| 136 | 136 | $progress = new ProgressBar($count); |
| 137 | 137 | |
| 138 | 138 | foreach ($applications as $application) { |
| 139 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
| 139 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
| 140 | 140 | try { |
| 141 | 141 | $documentManager->remove($application); |
| 142 | - } catch (\Exception $e){ |
|
| 142 | + } catch (\Exception $e) { |
|
| 143 | 143 | // log something |
| 144 | 144 | $e->getCode(); |
| 145 | 145 | } |
@@ -163,17 +163,17 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | $table->appendRow(array('Module', 'Name', 'Description')); |
| 165 | 165 | |
| 166 | - $offset=strlen(getcwd())+1; |
|
| 167 | - $links=""; |
|
| 168 | - $github='https://github.com/cross-solution/YAWIK/blob/master/'; |
|
| 166 | + $offset = strlen(getcwd()) + 1; |
|
| 167 | + $links = ""; |
|
| 168 | + $github = 'https://github.com/cross-solution/YAWIK/blob/master/'; |
|
| 169 | 169 | |
| 170 | 170 | foreach ($config['view_manager']['template_map'] as $key => $absolute_filename) { |
| 171 | 171 | // strip the application_root plus an additional slash |
| 172 | - $filename=substr(realpath($absolute_filename), $offset); |
|
| 172 | + $filename = substr(realpath($absolute_filename), $offset); |
|
| 173 | 173 | if (preg_match('~module/([^/]+)~', $filename, $match)) { |
| 174 | - $module=$match[1]; |
|
| 174 | + $module = $match[1]; |
|
| 175 | 175 | } else { |
| 176 | - $module="not found ($key)"; |
|
| 176 | + $module = "not found ($key)"; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | $viewModel = new ViewModel(); |
@@ -182,17 +182,17 @@ discard block |
||
| 182 | 182 | $row = new Row(); |
| 183 | 183 | $row->appendColumn(new Column($module)); |
| 184 | 184 | if ($filename) { |
| 185 | - $row->appendColumn(new Column('`' . $key . '`_')); |
|
| 186 | - $links.='.. _'. $key .': '. $github.$filename .PHP_EOL; |
|
| 185 | + $row->appendColumn(new Column('`'.$key.'`_')); |
|
| 186 | + $links .= '.. _'.$key.': '.$github.$filename.PHP_EOL; |
|
| 187 | 187 | } else { |
| 188 | 188 | $row->appendColumn(new Column("WRONG CONFIGURATION")); |
| 189 | 189 | } |
| 190 | - $comment=""; |
|
| 190 | + $comment = ""; |
|
| 191 | 191 | if (file_exists($absolute_filename)) { |
| 192 | - $src=file_get_contents($absolute_filename); |
|
| 193 | - $comment="file exists"; |
|
| 192 | + $src = file_get_contents($absolute_filename); |
|
| 193 | + $comment = "file exists"; |
|
| 194 | 194 | if (preg_match("/{{rtd:\s*(.*)}}/", $src, $match)) { |
| 195 | - $comment=$match['1']; |
|
| 195 | + $comment = $match['1']; |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | $row->appendColumn(new Column($comment)); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | { |
| 210 | 210 | echo "Loading applications... "; |
| 211 | 211 | |
| 212 | - $filter = \Zend\Json\Json::decode($this->params('filter', '{}'), \Zend\Json\Json::TYPE_ARRAY); |
|
| 212 | + $filter = \Zend\Json\Json::decode($this->params('filter', '{}'), \Zend\Json\Json::TYPE_ARRAY); |
|
| 213 | 213 | $filter['$or'] = array( |
| 214 | 214 | array('attachments' => array('$exists' => 1)), |
| 215 | 215 | array('contact.image' => array('$exists' => 1)), |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | return; |
| 224 | 224 | } |
| 225 | 225 | $progress = new ProgressBar($count); |
| 226 | - $i=0; |
|
| 226 | + $i = 0; |
|
| 227 | 227 | |
| 228 | 228 | foreach ($applications as $app) { |
| 229 | 229 | $progress->update($i++, "Process $i / $count"); |