Passed
Push — master ( 095fed...63a80c )
by Cody
05:44 queued 02:11
created
lib/MiniTemplator.class.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -315,18 +315,18 @@  discard block
 block discarded – undo
315 315
     switch (strtoupper($cmd)) {
316 316
     case '$BEGINBLOCK':
317 317
      if (!$this->processBeginBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd)) {
318
-             return false;
319
-     }
318
+                return false;
319
+        }
320 320
         break;
321 321
     case '$ENDBLOCK':
322 322
      if (!$this->processEndBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd)) {
323
-             return false;
324
-     }
323
+                return false;
324
+        }
325 325
         break;
326 326
     case '$INCLUDE':
327 327
      if (!$this->processincludeCmd($parms, $cmdTPosBegin, $cmdTPosEnd)) {
328
-             return false;
329
-     }
328
+                return false;
329
+        }
330 330
         $resumeFromStart = true;
331 331
         break;
332 332
     default:
@@ -848,8 +848,8 @@  discard block
 block discarded – undo
848 848
     switch ($this->outputMode) {
849 849
     case 0:            // output to PHP output stream
850 850
      if (!print($s)) {
851
-             $this->outputError = true;
852
-     }
851
+                $this->outputError = true;
852
+        }
853 853
         break;
854 854
     case 1:            // output to file
855 855
      $rc = fwrite($this->outputFileHandle, $s);
Please login to merge, or discard this patch.
docker/application/configure-db.php 3 patches
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
     $config['DB_PORT'] = env('DB_PORT');
27 27
     if (empty($config['DB_TYPE'])) {
28 28
         switch ($config['DB_PORT']) {
29
-            case 3306:
30
-                $config['DB_TYPE'] = 'mysql';
31
-                break;
32
-            case 5432:
33
-                $config['DB_TYPE'] = 'pgsql';
34
-                break;
35
-            default:
36
-                error('Database on non-standard port ' . $config['DB_PORT'] . ' and env DB_TYPE not present');
29
+        case 3306:
30
+            $config['DB_TYPE'] = 'mysql';
31
+            break;
32
+        case 5432:
33
+            $config['DB_TYPE'] = 'pgsql';
34
+            break;
35
+        default:
36
+            error('Database on non-standard port ' . $config['DB_PORT'] . ' and env DB_TYPE not present');
37 37
         }
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
     $eport = 3306;
17 17
 }
18 18
 if (!empty($eport)) {
19
-    $config['DB_HOST'] = env('DB_PORT_' . $eport . '_TCP_ADDR');
20
-    $config['DB_PORT'] = env('DB_PORT_' . $eport . '_TCP_PORT');
19
+    $config['DB_HOST'] = env('DB_PORT_'.$eport.'_TCP_ADDR');
20
+    $config['DB_PORT'] = env('DB_PORT_'.$eport.'_TCP_PORT');
21 21
 } elseif (getenv('DB_PORT') === false) {
22 22
     error('The env DB_PORT does not exist. Make sure to run with "--link mypostgresinstance:DB"');
23 23
 } elseif (is_numeric(getenv('DB_PORT')) && getenv('DB_HOST') !== false) {
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                 $config['DB_TYPE'] = 'pgsql';
34 34
                 break;
35 35
             default:
36
-                error('Database on non-standard port ' . $config['DB_PORT'] . ' and env DB_TYPE not present');
36
+                error('Database on non-standard port '.$config['DB_PORT'].' and env DB_TYPE not present');
37 37
         }
38 38
     }
39 39
 }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 $config['DB_USER'] = env('DB_USER', $config['DB_NAME']);
46 46
 $config['DB_PASS'] = env('DB_PASS', $config['DB_USER']);
47 47
 if (!dbcheck($config)) {
48
-    echo 'Database login failed, trying to create...' . PHP_EOL;
48
+    echo 'Database login failed, trying to create...'.PHP_EOL;
49 49
     // superuser account to create new database and corresponding user account
50 50
     //   username (SU_USER) can be supplied or defaults to "docker"
51 51
     //   password (SU_PASS) can be supplied or defaults to username
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
     $super['DB_PASS'] = env('DB_ENV_PASS', $super['DB_USER']);
56 56
     $pdo = dbconnect($super);
57 57
     if ($super['DB_TYPE'] === 'mysql') {
58
-        $pdo->exec('CREATE DATABASE ' . ($config['DB_NAME']));
59
-        $pdo->exec('GRANT ALL PRIVILEGES ON ' . ($config['DB_NAME']) . '.* TO ' . $pdo->quote($config['DB_USER']) . '@"%" IDENTIFIED BY ' . $pdo->quote($config['DB_PASS']));
58
+        $pdo->exec('CREATE DATABASE '.($config['DB_NAME']));
59
+        $pdo->exec('GRANT ALL PRIVILEGES ON '.($config['DB_NAME']).'.* TO '.$pdo->quote($config['DB_USER']).'@"%" IDENTIFIED BY '.$pdo->quote($config['DB_PASS']));
60 60
     } else {
61
-        $pdo->exec('CREATE ROLE ' . ($config['DB_USER']) . ' WITH LOGIN PASSWORD ' . $pdo->quote($config['DB_PASS']));
62
-        $pdo->exec('CREATE DATABASE ' . ($config['DB_NAME']) . ' WITH OWNER ' . ($config['DB_USER']));
61
+        $pdo->exec('CREATE ROLE '.($config['DB_USER']).' WITH LOGIN PASSWORD '.$pdo->quote($config['DB_PASS']));
62
+        $pdo->exec('CREATE DATABASE '.($config['DB_NAME']).' WITH OWNER '.($config['DB_USER']));
63 63
     }
64 64
     unset($pdo);
65 65
     if (dbcheck($config)) {
66
-        echo 'Database login created and confirmed' . PHP_EOL;
66
+        echo 'Database login created and confirmed'.PHP_EOL;
67 67
     } else {
68 68
         error('Database login failed, trying to create login failed as well');
69 69
     }
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
     // reached this point => table found, assume db is complete
75 75
 }
76 76
 catch (PDOException $e) {
77
-    echo 'Database table not found, applying schema... ' . PHP_EOL;
78
-    $schema = file_get_contents('schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql');
77
+    echo 'Database table not found, applying schema... '.PHP_EOL;
78
+    $schema = file_get_contents('schema/ttrss_schema_'.$config['DB_TYPE'].'.sql');
79 79
     $schema = preg_replace('/--(.*?);/', '', $schema);
80 80
     $schema = preg_replace('/[\r\n]/', ' ', $schema);
81 81
     $schema = trim($schema, ' ;');
@@ -88,35 +88,35 @@  discard block
 block discarded – undo
88 88
 foreach ($_SERVER as $name => $value) {
89 89
     if (strpos($name, $config_prefix) === 0) {
90 90
         $name = substr($name, strlen($config_prefix));
91
-        echo 'Getting config from env: ' . $name . PHP_EOL;
91
+        echo 'Getting config from env: '.$name.PHP_EOL;
92 92
         $config[$name] = $value;
93 93
     }
94 94
 }
95 95
 $contents = file_get_contents($confpath);
96 96
 foreach ($config as $name => $value) {
97
-    $contents = preg_replace('/(define\s*\(\'' . $name . '\',\s*)(.*)(\);)/', '$1"' . $value . '"$3', $contents);
97
+    $contents = preg_replace('/(define\s*\(\''.$name.'\',\s*)(.*)(\);)/', '$1"'.$value.'"$3', $contents);
98 98
 }
99 99
 file_put_contents($confpath, $contents);
100 100
 function env($name, $default = null)
101 101
 {
102 102
     $v = getenv($name) ?: $default;
103 103
     if ($v === null) {
104
-        error('The env ' . $name . ' does not exist');
104
+        error('The env '.$name.' does not exist');
105 105
     }
106 106
     return $v;
107 107
 }
108 108
 function error($text)
109 109
 {
110
-    echo 'Error: ' . $text . PHP_EOL;
110
+    echo 'Error: '.$text.PHP_EOL;
111 111
     exit(1);
112 112
 }
113 113
 function dbconnect($config)
114 114
 {
115 115
     $map = array('host' => 'HOST', 'port' => 'PORT', 'dbname' => 'NAME');
116
-    $dsn = $config['DB_TYPE'] . ':';
116
+    $dsn = $config['DB_TYPE'].':';
117 117
     foreach ($map as $d => $h) {
118
-        if (isset($config['DB_' . $h])) {
119
-            $dsn .= $d . '=' . $config['DB_' . $h] . ';';
118
+        if (isset($config['DB_'.$h])) {
119
+            $dsn .= $d.'='.$config['DB_'.$h].';';
120 120
         }
121 121
     }
122 122
     $pdo = new \PDO($dsn, $config['DB_USER'], $config['DB_PASS']);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@  discard block
 block discarded – undo
72 72
 try {
73 73
     $pdo->query('SELECT 1 FROM ttrss_feeds');
74 74
     // reached this point => table found, assume db is complete
75
-}
76
-catch (PDOException $e) {
75
+} catch (PDOException $e) {
77 76
     echo 'Database table not found, applying schema... ' . PHP_EOL;
78 77
     $schema = file_get_contents('schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql');
79 78
     $schema = preg_replace('/--(.*?);/', '', $schema);
@@ -128,8 +127,7 @@  discard block
 block discarded – undo
128 127
     try {
129 128
         dbconnect($config);
130 129
         return true;
131
-    }
132
-    catch (PDOException $e) {
130
+    } catch (PDOException $e) {
133 131
         return false;
134 132
     }
135 133
 }
Please login to merge, or discard this patch.
8c/8caf7b703c7d5b8d66cfe70ae4004bdfc8a929be0594bff5e96fc5518172abd8.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@
 block discarded – undo
201 201
 
202 202
     public function getDebugInfo()
203 203
     {
204
-        return array (  37 => 1,);
204
+        return array(37 => 1,);
205 205
     }
206 206
 
207 207
     public function getSourceContext()
Please login to merge, or discard this patch.
src/Components/Twig/Filters.php 1 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
                 }
33 33
                 if (T_CLASS === $tokens[$index][0] && T_WHITESPACE === $tokens[$index + 1][0] && T_STRING === $tokens[$index + 2][0]) {
34
-                    $index           += 2;
34
+                    $index += 2;
35 35
                     $filterClasses[] = $namespace.'\\'.$tokens[$index][1];
36 36
                     break;
37 37
                 }
Please login to merge, or discard this patch.
src/Components/Twig/Functions.php 1 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
                 }
33 33
                 if (T_CLASS === $tokens[$index][0] && T_WHITESPACE === $tokens[$index + 1][0] && T_STRING === $tokens[$index + 2][0]) {
34
-                    $index           += 2;
34
+                    $index += 2;
35 35
                     $functionClasses[] = $namespace.'\\'.$tokens[$index][1];
36 36
                     break;
37 37
                 }
Please login to merge, or discard this patch.
src/Components/Twig/Filters/StaticFiles.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     {
12 12
         $query = "";
13 13
         if (!(strpos($filename, "?") === false)) {
14
-            $query = substr($filename, strpos($filename, "?")+1);
14
+            $query = substr($filename, strpos($filename, "?") + 1);
15 15
             $filename = substr($filename, 0, strpos($filename, "?"));
16 16
         }
17 17
         $timestamp = filemtime(BASEPATH.DS.'public'.DS.'js'.DS.$filename);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@
 block discarded – undo
15 15
             $filename = substr($filename, 0, strpos($filename, "?"));
16 16
         }
17 17
         $timestamp = filemtime(BASEPATH.DS.'public'.DS.'js'.DS.$filename);
18
-        if ($query) $timestamp .= "&$query";
18
+        if ($query) {
19
+            $timestamp .= "&$query";
20
+        }
19 21
 
20 22
         return "<script type=\"text/javascript\" charset=\"utf-8\" src=\"/js/$filename?$timestamp\"></script>\n";
21 23
     }
Please login to merge, or discard this patch.
include/controls.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@
 block discarded – undo
264 264
  */
265 265
 function javascript_tag($filename)
266 266
 {
267
-	user_error(__FUNCTION__.' is deprecated', E_USER_DEPRECATED);
267
+    user_error(__FUNCTION__.' is deprecated', E_USER_DEPRECATED);
268 268
 }
269 269
 
270 270
 function format_warning($msg, $id = "") {
Please login to merge, or discard this patch.