Completed
Pull Request — develop (#241)
by ANTHONIUS
07:36
created
module/Install/src/Listener/LanguageSetter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,13 +79,13 @@
 block discarded – undo
79 79
 
80 80
         /* Set locale */
81 81
         $translator = $e->getApplication()->getServiceManager()->get('mvctranslator');
82
-        $locale     = $lang . '_' . strtoupper($lang);
82
+        $locale     = $lang.'_'.strtoupper($lang);
83 83
 
84 84
         setlocale(
85 85
             LC_ALL,
86 86
             array(
87
-                            $locale . ".utf8",
88
-                            $locale . ".iso88591",
87
+                            $locale.".utf8",
88
+                            $locale.".iso88591",
89 89
                             $locale,
90 90
                             substr($locale, 0, 2),
91 91
                             'de_DE.utf8',
Please login to merge, or discard this patch.
module/Install/src/Controller/Plugin/YawikConfigCreator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 
93 93
         // Create a file with the class/file map.
94 94
         // Stupid syntax highlighters make separating < from PHP declaration necessary
95
-        $content = '<' . "?php\n"
95
+        $content = '<'."?php\n"
96 96
                    . "\n"
97
-                   . 'return ' . var_export($config, true) . ';';
97
+                   . 'return '.var_export($config, true).';';
98 98
 
99 99
         // Fix \' strings from injected DIRECTORY_SEPARATOR usage in iterator_apply op
100 100
         $content = str_replace("\\'", "'", $content);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $content = str_replace('array (', 'array(', $content);
108 108
 
109 109
         // Make the file end by EOL
110
-        $content = rtrim($content, "\n") . "\n";
110
+        $content = rtrim($content, "\n")."\n";
111 111
 
112 112
         return $content;
113 113
 
Please login to merge, or discard this patch.
module/Install/src/autoload_classmap.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 // Generated by ZF2's ./bin/classmap_generator.php
3 3
 return array(
4
-  'Install\Filter\DbNameExtractor'                              => __DIR__ . '/Filter/DbNameExtractor.php',
5
-  'Install\Form\Installation'                                   => __DIR__ . '/Form/Installation.php',
6
-  'Install\Controller\Index'                                    => __DIR__ . '/Controller/Index.php',
7
-  'Install\Controller\Plugin\Prerequisites'                     => __DIR__ . '/Controller/Plugin/Prerequisites.php',
8
-  'Install\Controller\Plugin\YawikConfigCreator'                => __DIR__ . '/Controller/Plugin/YawikConfigCreator.php',
9
-  'Install\Controller\Plugin\UserCreator'                       => __DIR__ . '/Controller/Plugin/UserCreator.php',
10
-  'Install\Listener\LanguageSetter'                             => __DIR__ . '/Listener/LanguageSetter.php',
11
-  'Install\Validator\MongoDbConnection'                         => __DIR__ . '/Validator/MongoDbConnection.php',
12
-  'Install\Validator\MongoDbConnectionString'                   => __DIR__ . '/Validator/MongoDbConnectionString.php',
13
-  'Install\Factory\Controller\Plugin\UserCreatorFactory'        => __DIR__ . '/Factory/Controller/Plugin/UserCreatorFactory.php',
14
-  'Install\Factory\Controller\Plugin\YawikConfigCreatorFactory' => __DIR__ . '/Factory/Controller/Plugin/YawikConfigCreatorFactory.php',
4
+  'Install\Filter\DbNameExtractor'                              => __DIR__.'/Filter/DbNameExtractor.php',
5
+  'Install\Form\Installation'                                   => __DIR__.'/Form/Installation.php',
6
+  'Install\Controller\Index'                                    => __DIR__.'/Controller/Index.php',
7
+  'Install\Controller\Plugin\Prerequisites'                     => __DIR__.'/Controller/Plugin/Prerequisites.php',
8
+  'Install\Controller\Plugin\YawikConfigCreator'                => __DIR__.'/Controller/Plugin/YawikConfigCreator.php',
9
+  'Install\Controller\Plugin\UserCreator'                       => __DIR__.'/Controller/Plugin/UserCreator.php',
10
+  'Install\Listener\LanguageSetter'                             => __DIR__.'/Listener/LanguageSetter.php',
11
+  'Install\Validator\MongoDbConnection'                         => __DIR__.'/Validator/MongoDbConnection.php',
12
+  'Install\Validator\MongoDbConnectionString'                   => __DIR__.'/Validator/MongoDbConnectionString.php',
13
+  'Install\Factory\Controller\Plugin\UserCreatorFactory'        => __DIR__.'/Factory/Controller/Plugin/UserCreatorFactory.php',
14
+  'Install\Factory\Controller\Plugin\YawikConfigCreatorFactory' => __DIR__.'/Factory/Controller/Plugin/YawikConfigCreatorFactory.php',
15 15
 );
Please login to merge, or discard this patch.
module/Install/Module.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,23 +24,23 @@
 block discarded – undo
24 24
 
25 25
     public function getConfig()
26 26
     {
27
-        return include __DIR__ . '/config/module.config.php';
27
+        return include __DIR__.'/config/module.config.php';
28 28
     }
29 29
 
30 30
     public function getAutoloaderConfig()
31 31
     {
32 32
         return array(
33 33
             'Zend\Loader\ClassMapAutoloader' => array(
34
-                __DIR__ . '/autoload_classmap.php',
34
+                __DIR__.'/autoload_classmap.php',
35 35
                 array(
36 36
                     // We need this filter for initial user creation.
37
-                    'Auth\Entity\Filter\CredentialFilter' => __DIR__ . '/../Auth/src/Auth/Entity/Filter/CredentialFilter.php',
37
+                    'Auth\Entity\Filter\CredentialFilter' => __DIR__.'/../Auth/src/Auth/Entity/Filter/CredentialFilter.php',
38 38
                 ),
39 39
             ),
40 40
             'Zend\Loader\StandardAutoloader' => array(
41 41
                 'namespaces' => array(
42
-                    __NAMESPACE__ => __DIR__ . '/src' /* . __NAMESPACE__*/,
43
-                    __NAMESPACE__ . 'Test' => __DIR__ . '/test/' . __NAMESPACE__ . 'Test',
42
+                    __NAMESPACE__ => __DIR__.'/src' /* . __NAMESPACE__*/,
43
+                    __NAMESPACE__.'Test' => __DIR__.'/test/'.__NAMESPACE__.'Test',
44 44
                 ),
45 45
             ),
46 46
         );
Please login to merge, or discard this patch.
module/Install/autoload_classmap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,5 +8,5 @@
 block discarded – undo
8 8
 $env = getenv('APPLICATION_ENV') ?: 'production';
9 9
 
10 10
 return 'production' == $env
11
-       ? include __DIR__ . '/src/autoload_classmap.php'
11
+       ? include __DIR__.'/src/autoload_classmap.php'
12 12
        : array(); /* no class map in test and development. */
Please login to merge, or discard this patch.
module/Applications/src/Applications/Entity/Attachment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
33 33
      */
34 34
     public function getUri()
35 35
     {
36
-        return "/file/Applications.Attachment/" . $this->id . "/" .urlencode($this->name);
36
+        return "/file/Applications.Attachment/".$this->id."/".urlencode($this->name);
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
module/Applications/src/Applications/Entity/Status.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@
 block discarded – undo
50 50
 
51 51
     public function __construct($status = self::INCOMING)
52 52
     {
53
-        $constant = 'self::' . strtoupper($status);
53
+        $constant = 'self::'.strtoupper($status);
54 54
         if (!defined($constant)) {
55
-            throw new \DomainException('Unknown status: ' . $status);
55
+            throw new \DomainException('Unknown status: '.$status);
56 56
         }
57
-        $this->name=constant($constant);
58
-        $this->order=$this->getOrder();
57
+        $this->name = constant($constant);
58
+        $this->order = $this->getOrder();
59 59
     }
60 60
 
61 61
     /**
Please login to merge, or discard this patch.
module/Applications/src/Applications/Repository/Filter/PaginationQuery.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      *
24 24
      * @var String
25 25
      */
26
-    protected $repositoryName="Applications/Application";
26
+    protected $repositoryName = "Applications/Application";
27 27
     
28 28
     /**
29 29
      * Sortable fields
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             $searchPatterns = array();
82 82
     
83 83
             foreach (explode(' ', $search) as $searchItem) {
84
-                $searchPatterns[] = new \MongoRegex('/^' . $searchItem . '/');
84
+                $searchPatterns[] = new \MongoRegex('/^'.$searchItem.'/');
85 85
             }
86 86
             $queryBuilder->field('keywords')->all($searchPatterns);
87 87
         }
Please login to merge, or discard this patch.
module/Applications/src/Applications/Controller/ConsoleController.php 1 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.