Passed
Pull Request — master (#70)
by Felipe
03:51
created
src/help/PostgresDoc96.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 namespace PHPPgAdmin\Help;
4 4
 
5 5
 /**
6
-     * Help links for PostgreSQL 9.6 documentation.
7
-     */
6
+ * Help links for PostgreSQL 9.6 documentation.
7
+ */
8 8
     class PostgresDoc96 extends PostgresDoc95
9 9
     {
10 10
         public function __construct($conf, $major_version)
Please login to merge, or discard this patch.
src/lib.inc.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@  discard block
 block discarded – undo
7 7
  */
8 8
 defined('BASE_PATH') or define('BASE_PATH', dirname(__DIR__));
9 9
 
10
-define('THEME_PATH', BASE_PATH.'/src/themes');
10
+define('THEME_PATH', BASE_PATH . '/src/themes');
11 11
 // Enforce PHP environment
12 12
 ini_set('arg_separator.output', '&');
13 13
 
14
-ini_set('error_log', BASE_PATH.'/temp/logs/phppga.php_error.log');
14
+ini_set('error_log', BASE_PATH . '/temp/logs/phppga.php_error.log');
15 15
 
16 16
 // Check to see if the configuration file exists, if not, explain
17
-if (file_exists(BASE_PATH.'/config.inc.php')) {
17
+if (file_exists(BASE_PATH . '/config.inc.php')) {
18 18
     $conf = [];
19
-    include BASE_PATH.'/config.inc.php';
19
+    include BASE_PATH . '/config.inc.php';
20 20
 } else {
21 21
     die('Configuration error: Copy config.inc.php-dist to config.inc.php and edit appropriately.');
22 22
 }
23 23
 $debugmode = (!isset($conf['debugmode'])) ? false : boolval($conf['debugmode']);
24 24
 define('DEBUGMODE', $debugmode);
25 25
 
26
-require_once BASE_PATH.'/vendor/autoload.php';
26
+require_once BASE_PATH . '/vendor/autoload.php';
27 27
 
28 28
 if (!defined('ADODB_ERROR_HANDLER_TYPE')) {
29 29
     define('ADODB_ERROR_HANDLER_TYPE', E_USER_ERROR);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 $handler->start(); // initialize handlers*/
55 55
 \PhpConsole\Helper::register(); // it will register global PC class
56 56
 
57
-$composerinfo = json_decode(file_get_contents(BASE_PATH.'/composer.json'));
57
+$composerinfo = json_decode(file_get_contents(BASE_PATH . '/composer.json'));
58 58
 $appVersion = $composerinfo->version;
59 59
 
60 60
 $config = [
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         // backwards incompatible changes are made to config.inc.php-dist.
76 76
         'base_version'                      => 60,
77 77
         // Application version
78
-        'appVersion'                        => 'v'.$appVersion,
78
+        'appVersion'                        => 'v' . $appVersion,
79 79
         // Application name
80 80
         'appName'                           => 'phpPgAdmin6',
81 81
 
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
 //\Kint::dump($container->environment);die();
96 96
 
97 97
 $normalized_php_self = str_replace('/src/views', '', $container->environment->get('PHP_SELF'));
98
-$subfolder = str_replace('/'.basename($normalized_php_self), '', $normalized_php_self);
98
+$subfolder = str_replace('/' . basename($normalized_php_self), '', $normalized_php_self);
99 99
 define('SUBFOLDER', $subfolder);
100 100
 
101 101
 $container['errors'] = [];
102 102
 $container['requestobj'] = $container['request'];
103 103
 $container['responseobj'] = $container['response'];
104 104
 
105
-$container['utils'] = function ($c) {
105
+$container['utils'] = function($c) {
106 106
     $utils = new \PHPPgAdmin\ContainerUtils($c);
107 107
 
108 108
     return $utils;
109 109
 };
110 110
 
111
-$container['conf'] = function ($c) use ($conf) {
111
+$container['conf'] = function($c) use ($conf) {
112 112
 
113 113
     //\Kint::dump($conf);
114 114
     // Plugins are removed
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
     return $conf;
118 118
 };
119 119
 
120
-$container['lang'] = function ($c) {
121
-    include_once BASE_PATH.'/src/translations.php';
120
+$container['lang'] = function($c) {
121
+    include_once BASE_PATH . '/src/translations.php';
122 122
 
123 123
     $c['appLangFiles'] = $appLangFiles;
124 124
     $c['language'] = $_language;
@@ -127,16 +127,16 @@  discard block
 block discarded – undo
127 127
     return $lang;
128 128
 };
129 129
 
130
-$container['plugin_manager'] = function ($c) {
130
+$container['plugin_manager'] = function($c) {
131 131
     $plugin_manager = new \PHPPgAdmin\PluginManager($c);
132 132
 
133 133
     return $plugin_manager;
134 134
 };
135 135
 
136
-$container['serializer'] = function ($c) {
136
+$container['serializer'] = function($c) {
137 137
     $serializerbuilder = \JMS\Serializer\SerializerBuilder::create();
138 138
     $serializer = $serializerbuilder
139
-        ->setCacheDir(BASE_PATH.'/temp/jms')
139
+        ->setCacheDir(BASE_PATH . '/temp/jms')
140 140
         ->setDebug($c->get('settings')['debug'])
141 141
         ->build();
142 142
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 };
145 145
 
146 146
 // Create Misc class references
147
-$container['misc'] = function ($c) {
147
+$container['misc'] = function($c) {
148 148
     $misc = new \PHPPgAdmin\Misc($c);
149 149
 
150 150
     $conf = $c->get('conf');
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
     /* starting with PostgreSQL 9.0, we can set the application name */
158 158
     if (isset($_server_info['pgVersion']) && $_server_info['pgVersion'] >= 9) {
159
-        putenv('PGAPPNAME='.$c->get('settings')['appName'].'_'.$c->get('settings')['appVersion']);
159
+        putenv('PGAPPNAME=' . $c->get('settings')['appName'] . '_' . $c->get('settings')['appVersion']);
160 160
     }
161 161
 
162 162
     $themefolders = [];
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
                 continue;
169 169
             }
170 170
 
171
-            $folderpath = THEME_PATH.DIRECTORY_SEPARATOR.$foldername;
171
+            $folderpath = THEME_PATH . DIRECTORY_SEPARATOR . $foldername;
172 172
 
173 173
             // if $folderpath if indeed a folder and contains a global.css file, then it's a theme
174
-            if (is_dir($folderpath) && is_file($folderpath.DIRECTORY_SEPARATOR.'global.css')) {
174
+            if (is_dir($folderpath) && is_file($folderpath . DIRECTORY_SEPARATOR . 'global.css')) {
175 175
                 $themefolders[$foldername] = $folderpath;
176 176
             }
177 177
         }
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
 };
243 243
 
244 244
 // Register Twig View helper
245
-$container['view'] = function ($c) {
245
+$container['view'] = function($c) {
246 246
     $conf = $c->get('conf');
247 247
     $misc = $c->misc;
248 248
 
249
-    $view = new \Slim\Views\Twig(BASE_PATH.'/templates', [
250
-        'cache'       => BASE_PATH.'/temp/twigcache',
249
+    $view = new \Slim\Views\Twig(BASE_PATH . '/templates', [
250
+        'cache'       => BASE_PATH . '/temp/twigcache',
251 251
         'auto_reload' => $c->get('settings')['debug'],
252 252
         'debug'       => $c->get('settings')['debug'],
253 253
     ]);
@@ -278,18 +278,18 @@  discard block
 block discarded – undo
278 278
     return $view;
279 279
 };
280 280
 
281
-$container['haltHandler'] = function ($c) {
282
-    return function ($request, $response, $exits, $status = 500) use ($c) {
281
+$container['haltHandler'] = function($c) {
282
+    return function($request, $response, $exits, $status = 500) use ($c) {
283 283
         $title = 'PHPPgAdmin Error';
284 284
 
285 285
         $html = '<p>The application could not run because of the following error:</p>';
286 286
 
287 287
         $output = sprintf(
288
-            "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>".
289
-            '<title>%s</title><style>'.
290
-            'body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}'.
291
-            'h3{margin:0;font-size:28px;font-weight:normal;line-height:30px;}'.
292
-            'span{display:inline-block;font-size:16px;}'.
288
+            "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" .
289
+            '<title>%s</title><style>' .
290
+            'body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}' .
291
+            'h3{margin:0;font-size:28px;font-weight:normal;line-height:30px;}' .
292
+            'span{display:inline-block;font-size:16px;}' .
293 293
             '</style></head><body><h3>%s</h3><p>%s</p><span>%s</span></body></html>',
294 294
             $title,
295 295
             $title,
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 // Set the requestobj and responseobj properties of the container
311 311
 // as the value of $request and $response, which already contain the route
312
-$app->add(function ($request, $response, $next) {
312
+$app->add(function($request, $response, $next) {
313 313
     $this['requestobj'] = $request;
314 314
     $this['responseobj'] = $response;
315 315
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
     $query_string = $request->getUri()->getQuery();
322 322
     $this->view->offsetSet('query_string', $query_string);
323
-    $path = SUBFOLDER.'/'.$request->getUri()->getPath().($query_string ? '?'.$query_string : '');
323
+    $path = SUBFOLDER . '/' . $request->getUri()->getPath() . ($query_string ? '?' . $query_string : '');
324 324
     $this->view->offsetSet('path', $path);
325 325
     $this->view->offsetSet('params', $request->getParams());
326 326
 
Please login to merge, or discard this patch.
src/decorators/UrlDecorator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
             $sep = '?';
27 27
             ksort($queryVars);
28 28
             foreach ($queryVars as $var => $value) {
29
-                $url .= $sep.Decorator::value_url($var, $fields).'='.Decorator::value_url($value, $fields);
29
+                $url .= $sep . Decorator::value_url($var, $fields) . '=' . Decorator::value_url($value, $fields);
30 30
                 $sep = '&';
31 31
             }
32 32
         }
33 33
         //$this->prtrace('url before', $url);
34 34
         if (SUBFOLDER !== '' && (strpos($url, '/') === 0) && (strpos($url, SUBFOLDER) === false)) {
35
-            $url = str_replace('//', '/', SUBFOLDER.'/'.$url);
35
+            $url = str_replace('//', '/', SUBFOLDER . '/' . $url);
36 36
         }
37 37
         //$this->prtrace('url after', $url);
38 38
         return $url;
Please login to merge, or discard this patch.
src/decorators/ActionUrlDecorator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@
 block discarded – undo
27 27
             $sep = '?';
28 28
             ksort($queryVars);
29 29
             foreach ($queryVars as $var => $value) {
30
-                $url .= $sep.Decorator::value_url($var, $fields).'='.Decorator::value_url($value, $fields);
30
+                $url .= $sep . Decorator::value_url($var, $fields) . '=' . Decorator::value_url($value, $fields);
31 31
                 $sep = '&';
32 32
             }
33 33
         }
34 34
 
35
-        return SUBFOLDER.'/src/views/'.str_replace('.php', '', $url);
35
+        return SUBFOLDER . '/src/views/' . str_replace('.php', '', $url);
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
src/decorators/BranchUrlDecorator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@
 block discarded – undo
32 32
                 $varvalue = Decorator::value_url($value, $fields);
33 33
                 if ($varname == 'action') {
34 34
                     if ($varvalue == 'subtree') {
35
-                        $url = '/tree/'.str_replace('.php', '/subtree', $url);
35
+                        $url = '/tree/' . str_replace('.php', '/subtree', $url);
36 36
                     } else {
37
-                        $url = '/tree/'.str_replace('.php', '', $url);
37
+                        $url = '/tree/' . str_replace('.php', '', $url);
38 38
                     }
39 39
                 }
40
-                $url .= $sep.$varname.'='.$varvalue;
40
+                $url .= $sep . $varname . '=' . $varvalue;
41 41
                 $sep = '&';
42 42
             }
43 43
         }
44 44
         if (SUBFOLDER !== '' && (strpos($url, '/') === 0) && (strpos($url, SUBFOLDER) === false)) {
45
-            $url = str_replace('//', '/', SUBFOLDER.'/'.$url);
45
+            $url = str_replace('//', '/', SUBFOLDER . '/' . $url);
46 46
         }
47 47
 
48 48
         return str_replace('.php', '', $url);
Please login to merge, or discard this patch.
src/decorators/RedirectUrlDecorator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,16 +34,16 @@
 block discarded – undo
34 34
                 $varname = Decorator::value_url($var, $fields);
35 35
                 $varvalue = Decorator::value_url($value, $fields);
36 36
                 if ($varname == 'subject') {
37
-                    $url = '/'.str_replace('.php', '/'.$varvalue, $url);
37
+                    $url = '/' . str_replace('.php', '/' . $varvalue, $url);
38 38
                 } else {
39
-                    $url .= $sep.$varname.'='.$varvalue;
39
+                    $url .= $sep . $varname . '=' . $varvalue;
40 40
                 }
41 41
 
42 42
                 $sep = '&';
43 43
             }
44 44
         }
45 45
         if (SUBFOLDER !== '' && (strpos($url, '/') === 0) && (strpos($url, SUBFOLDER) === false)) {
46
-            $url = str_replace('//', '/', SUBFOLDER.'/'.$url);
46
+            $url = str_replace('//', '/', SUBFOLDER . '/' . $url);
47 47
         }
48 48
 
49 49
         return str_replace('.php', '', $url);
Please login to merge, or discard this patch.
src/xhtml/HTMLController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
         ksort($urlvars);
101 101
         foreach ($urlvars as $var => $varfield) {
102
-            $url .= $sep.Decorator::value_url($var, $fields).'='.Decorator::value_url($varfield, $fields);
102
+            $url .= $sep . Decorator::value_url($var, $fields) . '=' . Decorator::value_url($varfield, $fields);
103 103
             $sep = '&';
104 104
         }
105 105
 
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
         $tag = '<a ';
139 139
         foreach ($link['attr'] as $attr => $value) {
140 140
             if ($attr == 'href' and is_array($value)) {
141
-                $tag .= 'href="'.htmlentities($this->getActionUrl($value, $link['fields'], $from)).'" ';
141
+                $tag .= 'href="' . htmlentities($this->getActionUrl($value, $link['fields'], $from)) . '" ';
142 142
             } else {
143
-                $tag .= htmlentities($attr).'="'.Decorator::get_sanitized_value($value, $link['fields'], 'html').'" ';
143
+                $tag .= htmlentities($attr) . '="' . Decorator::get_sanitized_value($value, $link['fields'], 'html') . '" ';
144 144
             }
145 145
         }
146
-        $tag .= '>'.Decorator::get_sanitized_value($link['content'], $link['fields'], 'html')."</a>\n";
146
+        $tag .= '>' . Decorator::get_sanitized_value($link['content'], $link['fields'], 'html') . "</a>\n";
147 147
 
148 148
         if ($do_print) {
149 149
             echo $tag;
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
     {
174 174
         $htmlOut = '';
175 175
         if ($bMultiple) { // If multiple select combo
176
-            $htmlOut .= "<select rel=\"printCombo\" name=\"$szName\" id=\"$szName\" multiple=\"multiple\" size=\"$iSize\">"."\n";
176
+            $htmlOut .= "<select rel=\"printCombo\" name=\"$szName\" id=\"$szName\" multiple=\"multiple\" size=\"$iSize\">" . "\n";
177 177
         } else {
178
-            $htmlOut .= "<select rel=\"printCombo\" class=\"select2\" name=\"$szName\" id=\"$szName\">"."\n";
178
+            $htmlOut .= "<select rel=\"printCombo\" class=\"select2\" name=\"$szName\" id=\"$szName\">" . "\n";
179 179
         }
180 180
 
181 181
         if ($bBlankEntry) {
Please login to merge, or discard this patch.
src/xhtml/HTMLTableController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             }
90 90
 
91 91
             if ($this->has_ma) {
92
-                $tablehtml .= '<script src="'.SUBFOLDER."/js/multiactionform.js\" type=\"text/javascript\"></script>\n";
92
+                $tablehtml .= '<script src="' . SUBFOLDER . "/js/multiactionform.js\" type=\"text/javascript\"></script>\n";
93 93
                 $tablehtml .= "<form id=\"multi_form\" action=\"{$this->ma['url']}\" method=\"post\" enctype=\"multipart/form-data\">\n";
94 94
                 if (isset($this->ma['vars'])) {
95 95
                     foreach ($this->ma['vars'] as $k => $v) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 }
99 99
             }
100 100
 
101
-            $tablehtml .= '<table width="auto" class="will_be_datatable '.$place.'">'."\n";
101
+            $tablehtml .= '<table width="auto" class="will_be_datatable ' . $place . '">' . "\n";
102 102
 
103 103
             $tablehtml .= $this->getThead($columns, $actions);
104 104
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                     if (isset($a['multiaction'])) {
138 138
                         $selected = $this->ma['default'] == $k ? ' selected="selected" ' : '';
139 139
                         $tablehtml .= "\t\t";
140
-                        $tablehtml .= '<option value="'.$a['multiaction'].'" '.$selected.' rel="'.$k.'">'.$a['content'].'</option>';
140
+                        $tablehtml .= '<option value="' . $a['multiaction'] . '" ' . $selected . ' rel="' . $k . '">' . $a['content'] . '</option>';
141 141
                         $tablehtml .= "\n";
142 142
                     }
143 143
                 }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 }
186 186
                 //\Kint::dump($a);
187 187
                 $tbody_html .= '<td>';
188
-                $tbody_html .= '<input type="checkbox" name="ma[]" value="'.htmlentities(serialize($a), ENT_COMPAT, 'UTF-8').'" />';
188
+                $tbody_html .= '<input type="checkbox" name="ma[]" value="' . htmlentities(serialize($a), ENT_COMPAT, 'UTF-8') . '" />';
189 189
                 $tbody_html .= "</td>\n";
190 190
             }
191 191
 
@@ -271,12 +271,12 @@  discard block
 block discarded – undo
271 271
             switch ($column_id) {
272 272
                 case 'actions':
273 273
                     if (count($actions) > 0) {
274
-                        $thead_html .= '<th class="data" colspan="'.count($actions).'">'.$column['title'].'</th>'."\n";
274
+                        $thead_html .= '<th class="data" colspan="' . count($actions) . '">' . $column['title'] . '</th>' . "\n";
275 275
                     }
276 276
 
277 277
                     break;
278 278
                 default:
279
-                    $thead_html .= '<th class="data'.$this->class.'">';
279
+                    $thead_html .= '<th class="data' . $this->class . '">';
280 280
                     if (isset($column['help'])) {
281 281
                         $thead_html .= $this->misc->printHelp($column['title'], $column['help'], false);
282 282
                     } else {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
             switch ($column_id) {
313 313
                 case 'actions':
314 314
                     if (count($actions) > 0) {
315
-                        $tfoot_html .= '<td class="data" colspan="'.count($actions)."\"></td>\n";
315
+                        $tfoot_html .= '<td class="data" colspan="' . count($actions) . "\"></td>\n";
316 316
                     }
317 317
 
318 318
                     break;
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
     {
340 340
         $url_vars_html = '';
341 341
         foreach ($vars as $var => $varfield) {
342
-            $url_vars_html .= "{$var}=".urlencode($fields[$varfield]).'&amp;';
342
+            $url_vars_html .= "{$var}=" . urlencode($fields[$varfield]) . '&amp;';
343 343
         }
344 344
         if ($do_print) {
345 345
             echo $url_vars_html;
Please login to merge, or discard this patch.
src/xhtml/HTMLHeaderController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
             $viewVars['applocale'] = $lang['applocale'];
51 51
         }
52 52
 
53
-        $viewVars['dir'] = (strcasecmp($lang['applangdir'], 'ltr') != 0) ? ' dir="'.htmlspecialchars($lang['applangdir']).'"' : '';
53
+        $viewVars['dir'] = (strcasecmp($lang['applangdir'], 'ltr') != 0) ? ' dir="' . htmlspecialchars($lang['applangdir']) . '"' : '';
54 54
         $viewVars['headertemplate'] = $template;
55
-        $viewVars['title'] = ($title !== '') ? ' - '.$title : '';
56
-        $viewVars['appName'] = htmlspecialchars($this->appName).(($title != '') ? htmlspecialchars(" - {$title}") : '');
55
+        $viewVars['title'] = ($title !== '') ? ' - ' . $title : '';
56
+        $viewVars['appName'] = htmlspecialchars($this->appName) . (($title != '') ? htmlspecialchars(" - {$title}") : '');
57 57
 
58 58
         $viewVars['script'] = $script;
59 59
         //$this->prtrace($viewVars);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function printBody($doBody = true, $bodyClass = 'detailbody')
86 86
     {
87 87
         $bodyClass = htmlspecialchars($bodyClass);
88
-        $bodyHtml = '<body data-controller="'.$this->controller_name.'" class="'.$this->lang['applangdir'].' '.$bodyClass.'" >';
88
+        $bodyHtml = '<body data-controller="' . $this->controller_name . '" class="' . $this->lang['applangdir'] . ' ' . $bodyClass . '" >';
89 89
         $bodyHtml .= "\n";
90 90
         /*$bodyHtml .= '<div id="flexbox_wrapper">';
91 91
         $bodyHtml .= "\n";
Please login to merge, or discard this patch.