Passed
Branch develop (96efe9)
by Jens
02:38
created
src/components/BaseComponent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         {
46 46
             $this->template = $template;
47 47
             $this->request = $request;
48
-            $this->parameters = (array)$parameters;
48
+            $this->parameters = (array) $parameters;
49 49
             $this->matchedSitemapItem = $matchedSitemapItem;
50 50
         }
51 51
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 return ob_get_contents();
112 112
             } else {
113 113
                 if ($template !== null) { // If template is null, its a application component, which doesnt have a template
114
-                    throw new \Exception('Couldnt find template ' . $templatePath);
114
+                    throw new \Exception('Couldnt find template '.$templatePath);
115 115
                 }
116 116
             }
117 117
         }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             if ($application !== null) {
153 153
                 $templatePath = $application->getTemplateDir();
154 154
             }
155
-            $templatePath = $templatePath . $template . '.php';
155
+            $templatePath = $templatePath.$template.'.php';
156 156
             return $templatePath;
157 157
         }
158 158
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             if ($application !== null) {
168 168
                 $rootDir = $application->getRootDir();
169 169
                 if (strpos($templateDir, $rootDir) === false) {
170
-                    $templatePath = $rootDir . DIRECTORY_SEPARATOR . $templateDir;
170
+                    $templatePath = $rootDir.DIRECTORY_SEPARATOR.$templateDir;
171 171
                 } else {
172 172
                     $templatePath = $templateDir;
173 173
                 }
Please login to merge, or discard this patch.
src/CloudControl.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
         $event->getIO()->write("");
41 41
 
42 42
         $vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
43
-        $rootDir = realpath($vendorDir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
43
+        $rootDir = realpath($vendorDir.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR);
44 44
 
45
-        $baseConfigTargetPath = $rootDir . DIRECTORY_SEPARATOR . 'config.json';
45
+        $baseConfigTargetPath = $rootDir.DIRECTORY_SEPARATOR.'config.json';
46 46
         $configObject = self::getConfig($event, $baseConfigTargetPath);
47 47
 
48 48
         $configObject->{'vendorDir'} = realpath($vendorDir);
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
         $configObject->{'templateDir'} = self::createDir($event, $rootDir, 'templates');
51 51
         $configObject->{'storageDir'} = self::createDir($event, $rootDir, $configObject->{'storageDir'});
52 52
         $configObject->{'publicDir'} = self::createDir($event, $rootDir, 'public');
53
-        $configObject->{'jsDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'} . 'js');
54
-        $configObject->{'cssDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'} . 'css');
55
-        $configObject->{'imagesDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'} . 'images');
56
-        $configObject->{'filesDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'} . 'files');
53
+        $configObject->{'jsDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'}.'js');
54
+        $configObject->{'cssDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'}.'css');
55
+        $configObject->{'imagesDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'}.'images');
56
+        $configObject->{'filesDir'} = self::createDir($event, $rootDir, $configObject->{'publicDir'}.'files');
57 57
 
58
-        $baseStorageDefaultPath = __DIR__ . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . '_storage.json';
59
-        $baseStorageSqlPath = __DIR__ . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . '_storage.sql';
58
+        $baseStorageDefaultPath = __DIR__.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'_storage.json';
59
+        $baseStorageSqlPath = __DIR__.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'_storage.sql';
60 60
 
61 61
         self::createStorage($configObject->{'storageDir'}, $baseStorageDefaultPath, $baseStorageSqlPath);
62 62
         self::saveConfig($event, $baseConfigTargetPath, $configObject);
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
     private static function saveConfig(Event $event, $baseConfigTargetPath, $configObject)
88 88
     {
89 89
         file_put_contents($baseConfigTargetPath, json_encode($configObject));
90
-        $event->getIO()->write("[INFO] Saved config to: " . $baseConfigTargetPath);
90
+        $event->getIO()->write("[INFO] Saved config to: ".$baseConfigTargetPath);
91 91
     }
92 92
 
93 93
     private static function copyInstallFile(Event $event, $sourceFileName, $destinationPath, $destinationFileName = null)
94 94
     {
95
-        $sourceFilePath = realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install/_' . $sourceFileName);
95
+        $sourceFilePath = realpath(__DIR__.DIRECTORY_SEPARATOR.'install/_'.$sourceFileName);
96 96
 
97 97
 
98 98
         if ($destinationFileName === null) {
@@ -100,15 +100,15 @@  discard block
 block discarded – undo
100 100
         }
101 101
 
102 102
         if (file_exists($sourceFilePath) && realpath($destinationPath) !== false) {
103
-            $destinationFullPath = realpath($destinationPath) . DIRECTORY_SEPARATOR . $destinationFileName;
103
+            $destinationFullPath = realpath($destinationPath).DIRECTORY_SEPARATOR.$destinationFileName;
104 104
             if (file_exists($destinationFullPath)) {
105
-                $event->getIO()->write("[INFO] File already exists: " . $destinationFullPath);
105
+                $event->getIO()->write("[INFO] File already exists: ".$destinationFullPath);
106 106
             } else {
107 107
                 copy($sourceFilePath, $destinationFullPath);
108
-                $event->getIO()->write("[INSTALL] Copied file: " . $sourceFileName . ' to ' . $destinationPath);
108
+                $event->getIO()->write("[INSTALL] Copied file: ".$sourceFileName.' to '.$destinationPath);
109 109
             }
110 110
         } else {
111
-            $event->getIO()->write("[ERROR] Couldnt copy file: " . $sourceFileName . ' to ' . $destinationPath);
111
+            $event->getIO()->write("[ERROR] Couldnt copy file: ".$sourceFileName.' to '.$destinationPath);
112 112
         }
113 113
     }
114 114
 
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 
126 126
     private static function createDir(Event $event, $rootDir, $dirName)
127 127
     {
128
-        $dir = $rootDir . DIRECTORY_SEPARATOR . $dirName . DIRECTORY_SEPARATOR;
128
+        $dir = $rootDir.DIRECTORY_SEPARATOR.$dirName.DIRECTORY_SEPARATOR;
129 129
         if (!is_dir($dir)) {
130 130
             mkdir($dir);
131
-            $event->getIO()->write("[INSTALL] Created dir: " . $dir);
131
+            $event->getIO()->write("[INSTALL] Created dir: ".$dir);
132 132
         } else {
133
-            $event->getIO()->write("[INFO] Dir already exists: " . $dir);
133
+            $event->getIO()->write("[INFO] Dir already exists: ".$dir);
134 134
         }
135 135
         return self::getRelativePath($rootDir, $dir);
136 136
     }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     private static function getConfig(Event $event, $configTargetPath)
143 143
     {
144
-        $baseConfigDefaultPath = realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . '_config.json');
144
+        $baseConfigDefaultPath = realpath(__DIR__.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'_config.json');
145 145
 
146 146
         if (file_exists($configTargetPath)) {
147 147
             $config = json_decode(file_get_contents($configTargetPath));
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
     private static function getRelativePath($from, $to)
165 165
     {
166 166
         // some compatibility fixes for Windows paths
167
-        $from = is_dir($from) ? rtrim($from, '\/') . DIRECTORY_SEPARATOR : $from;
168
-        $to = is_dir($to) ? rtrim($to, '\/') . DIRECTORY_SEPARATOR : $to;
167
+        $from = is_dir($from) ? rtrim($from, '\/').DIRECTORY_SEPARATOR : $from;
168
+        $to = is_dir($to) ? rtrim($to, '\/').DIRECTORY_SEPARATOR : $to;
169 169
         $from = str_replace('\\', DIRECTORY_SEPARATOR, $from);
170 170
         $to = str_replace('\\', DIRECTORY_SEPARATOR, $to);
171 171
 
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
      */
186 186
     private static function removePointerToCurrentDir($relPath)
187 187
     {
188
-        while (strpos($relPath, '.' . DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR) !== false) {
189
-            $relPath = str_replace('.' . DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR, '.' . DIRECTORY_SEPARATOR, $relPath);
188
+        while (strpos($relPath, '.'.DIRECTORY_SEPARATOR.'.'.DIRECTORY_SEPARATOR) !== false) {
189
+            $relPath = str_replace('.'.DIRECTORY_SEPARATOR.'.'.DIRECTORY_SEPARATOR, '.'.DIRECTORY_SEPARATOR, $relPath);
190 190
         }
191 191
         return $relPath;
192 192
     }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     $relPath = array_pad($relPath, $padLength, '..');
214 214
                     break;
215 215
                 } else {
216
-                    $relPath[0] = '.' . DIRECTORY_SEPARATOR . $relPath[0];
216
+                    $relPath[0] = '.'.DIRECTORY_SEPARATOR.$relPath[0];
217 217
                 }
218 218
             }
219 219
         }
Please login to merge, or discard this patch.
src/util/functions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
     $debug_backtrace = current(debug_backtrace());
13 13
     if (PHP_SAPI == 'cli') {
14
-        echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n";
14
+        echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n";
15 15
         foreach (func_get_args() as $data) {
16 16
             var_dump($data);
17 17
         }
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 <body>
30 30
 END;
31 31
 
32
-        echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>";
32
+        echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>";
33 33
         echo '<pre>';
34 34
         foreach (func_get_args() as $data) {
35 35
             echo "<code>";
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 {
56 56
     if (!isset($_GET['unsanitized'])) {
57 57
         $search = array(
58
-            '/\>[^\S ]+/s',     // strip whitespaces after tags, except space
59
-            '/[^\S ]+\</s',     // strip whitespaces before tags, except space
60
-            '/(\s)+/s',         // shorten multiple whitespace sequences
58
+            '/\>[^\S ]+/s', // strip whitespaces after tags, except space
59
+            '/[^\S ]+\</s', // strip whitespaces before tags, except space
60
+            '/(\s)+/s', // shorten multiple whitespace sequences
61 61
             '/<!--(.|\s)*?-->/' // Remove HTML comments
62 62
         );
63 63
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
  */
86 86
 function utf8Convert($array)
87 87
 {
88
-    array_walk_recursive($array, function (&$item) {
88
+    array_walk_recursive($array, function(&$item) {
89 89
         if (!mb_detect_encoding($item, 'utf-8', true)) {
90 90
             $item = utf8_encode($item);
91 91
         }
Please login to merge, or discard this patch.