Completed
Pull Request — develop (#235)
by ANTHONIUS
07:49
created
module/Organizations/src/Organizations/Entity/OrganizationReference.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@
 block discarded – undo
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
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Organizations/Repository/Filter/PaginationQueryFactory.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      *
28 28
      * @see \Zend\ServiceManager\FactoryInterface::createService()
29 29
      * @param ServiceLocatorInterface $serviceLocator
30
-     * @return \Organizations\Repository\Filter\PaginationQuery|mixed
30
+     * @return PaginationQuery
31 31
      */
32 32
     public function createService(ServiceLocatorInterface $serviceLocator)
33 33
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      */
32 32
     public function createService(ServiceLocatorInterface $serviceLocator)
33 33
     {
34
-        $auth  = $serviceLocator->getServiceLocator()->get('AuthenticationService');
34
+        $auth = $serviceLocator->getServiceLocator()->get('AuthenticationService');
35 35
         $filter = new PaginationQuery($auth);
36 36
         return $filter;
37 37
     }
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Repository/OrganizationName.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -14,6 +14,9 @@
 block discarded – undo
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));
Please login to merge, or discard this patch.
module/Pdf/Module.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@
 block discarded – undo
30 30
  */
31 31
 class Module
32 32
 {
33
-     /**
34
-     * Loads module specific configuration.
35
-     *
36
-     * @return array
37
-     */
33
+        /**
34
+         * Loads module specific configuration.
35
+         *
36
+         * @return array
37
+         */
38 38
     public function getConfig()
39 39
     {
40 40
         return ModuleConfigLoader::load(__DIR__ . '/config');
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                         }
Please login to merge, or discard this patch.
module/Settings/src/Settings/Form/FormAbstract.php 1 patch
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -50,6 +50,11 @@  discard block
 block discarded – undo
50 50
         return $this->hydrator;
51 51
     }
52 52
     
53
+    /**
54
+     * @param string $name
55
+     *
56
+     * @return callable
57
+     */
53 58
     protected function getPlugin($name)
54 59
     {
55 60
         $plugin = null;
@@ -88,5 +93,8 @@  discard block
 block discarded – undo
88 93
         $this->add($this->forms->get('DefaultButtonsFieldset'));
89 94
     }
90 95
     
96
+    /**
97
+     * @return string
98
+     */
91 99
     abstract public function getCoreFieldset();
92 100
 }
Please login to merge, or discard this patch.
module/Settings/src/Settings/Repository/Settings.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,6 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
config/config.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@
 block discarded – undo
16 16
     $modules = array('Install');
17 17
 } else {
18 18
     $modules = array(
19
-             'DoctrineModule',
20
-             'DoctrineMongoODMModule',
21
-             'Core',
22
-             'Auth',
23
-             'Cv',
24
-             'Applications',
25
-             'Jobs',
26
-             'Settings',
27
-             'Pdf',
28
-             'Geo',
29
-             'Organizations',
19
+                'DoctrineModule',
20
+                'DoctrineMongoODMModule',
21
+                'Core',
22
+                'Auth',
23
+                'Cv',
24
+                'Applications',
25
+                'Jobs',
26
+                'Settings',
27
+                'Pdf',
28
+                'Geo',
29
+                'Organizations',
30 30
         );
31 31
 
32 32
     if (!isset($allModules)) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
module/Applications/Module.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@
 block discarded – undo
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
     
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
module/Applications/src/Applications/Controller/ConsoleController.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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");
Please login to merge, or discard this patch.