Skip to content

Commit a771a10

Browse files
authored
Merge pull request #3797 from paulbalandan/no-spaces-inside-parenthesis
Remove extra spaces inside parentheses
2 parents 58993fb + e739cb7 commit a771a10

15 files changed

Lines changed: 27 additions & 26 deletions

File tree

system/Autoloader/FileLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function getClassname(string $file) : string
207207
}
208208
}
209209

210-
if (empty( $className ))
210+
if (empty($className))
211211
{
212212
return '';
213213
}

system/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ function is_really_writable(string $file): bool
800800
return true;
801801
}
802802

803-
if (! is_file($file) || ( $fp = @fopen($file, 'ab')) === false)
803+
if (! is_file($file) || ($fp = @fopen($file, 'ab')) === false)
804804
{
805805
return false;
806806
}

system/ComposerScripts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ protected static function copyDir($source, $dest)
157157
$dir = opendir($source);
158158
@mkdir($dest);
159159

160-
while (false !== ( $file = readdir($dir)))
160+
while (false !== ($file = readdir($dir)))
161161
{
162-
if (( $file !== '.' ) && ( $file !== '..' ))
162+
if (($file !== '.') && ($file !== '..'))
163163
{
164164
if (is_dir($source . '/' . $file))
165165
{

system/Database/BaseBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ protected function groupEndPrepare(string $clause = 'QBWhere')
15061506
{
15071507
$this->QBWhereGroupStarted = false;
15081508
$where = [
1509-
'condition' => str_repeat(' ', $this->QBWhereGroupCount -- ) . ')',
1509+
'condition' => str_repeat(' ', $this->QBWhereGroupCount--) . ')',
15101510
'escape' => false,
15111511
];
15121512

@@ -2993,7 +2993,7 @@ protected function compileSelect($selectOverride = false): string
29932993
}
29942994
else
29952995
{
2996-
$sql = ( ! $this->QBDistinct) ? 'SELECT ' : 'SELECT DISTINCT ';
2996+
$sql = (! $this->QBDistinct) ? 'SELECT ' : 'SELECT DISTINCT ';
29972997

29982998
if (empty($this->QBSelect))
29992999
{

system/Database/BaseConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ public function escapeIdentifiers($item)
12921292
// Avoid breaking functions and literal values inside queries
12931293
if (ctype_digit($item)
12941294
|| $item[0] === "'"
1295-
|| ( $this->escapeChar !== '"' && $item[0] === '"')
1295+
|| ($this->escapeChar !== '"' && $item[0] === '"')
12961296
|| strpos($item, '(') !== false)
12971297
{
12981298
return $item;
@@ -1379,7 +1379,7 @@ public function escape($str)
13791379
return array_map([&$this, 'escape'], $str);
13801380
}
13811381

1382-
if (is_string($str) || ( is_object($str) && method_exists($str, '__toString')))
1382+
if (is_string($str) || (is_object($str) && method_exists($str, '__toString')))
13831383
{
13841384
return "'" . $this->escapeString($str) . "'";
13851385
}

system/Database/Postgre/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function getVersion(): string
175175
}
176176

177177
// @phpstan-ignore-next-line
178-
if (! $this->connID || ( $pgVersion = pg_version($this->connID)) === false)
178+
if (! $this->connID || ($pgVersion = pg_version($this->connID)) === false)
179179
{
180180
$this->initialize();
181181
}
@@ -238,7 +238,7 @@ public function escape($str)
238238
$this->initialize();
239239
}
240240

241-
if (is_string($str) || ( is_object($str) && method_exists($str, '__toString')))
241+
if (is_string($str) || (is_object($str) && method_exists($str, '__toString')))
242242
{
243243
return pg_escape_literal($this->connID, $str);
244244
}

system/HTTP/IncomingRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ protected function removeRelativeDirectory(string $uri): string
797797
$tok = strtok($uri, '/');
798798
while ($tok !== false)
799799
{
800-
if (( ! empty($tok) || $tok === '0') && $tok !== '..')
800+
if ((! empty($tok) || $tok === '0') && $tok !== '..')
801801
{
802802
$uris[] = $tok;
803803
}

system/Helpers/filesystem_helper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,17 +439,17 @@ function symbolic_permissions(int $perms): string
439439
// Owner
440440
$symbolic .= (($perms & 0x0100) ? 'r' : '-')
441441
. (($perms & 0x0080) ? 'w' : '-')
442-
. (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-'));
442+
. (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-'));
443443

444444
// Group
445445
$symbolic .= (($perms & 0x0020) ? 'r' : '-')
446446
. (($perms & 0x0010) ? 'w' : '-')
447-
. (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-'));
447+
. (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-'));
448448

449449
// World
450450
$symbolic .= (($perms & 0x0004) ? 'r' : '-')
451451
. (($perms & 0x0002) ? 'w' : '-')
452-
. (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-'));
452+
. (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-'));
453453

454454
return $symbolic;
455455
}

system/Helpers/form_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ function form_checkbox($data = '', string $value = '', bool $checked = false, $e
461461
{
462462
$defaults = [
463463
'type' => 'checkbox',
464-
'name' => ( ! is_array($data) ? $data : ''),
464+
'name' => (! is_array($data) ? $data : ''),
465465
'value' => $value,
466466
];
467467

system/Helpers/number_helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function number_to_size($num, int $precision = 1, string $locale = null)
7171

7272
// ignore sub part
7373
$generalLocale = $locale;
74-
if (! empty($locale) && ( $underscorePos = strpos($locale, '_')))
74+
if (! empty($locale) && ($underscorePos = strpos($locale, '_')))
7575
{
7676
$generalLocale = substr($locale, 0, $underscorePos);
7777
}
@@ -142,7 +142,7 @@ function number_to_amount($num, int $precision = 0, string $locale = null)
142142

143143
// ignore sub part
144144
$generalLocale = $locale;
145-
if (! empty($locale) && ( $underscorePos = strpos($locale, '_')))
145+
if (! empty($locale) && ($underscorePos = strpos($locale, '_')))
146146
{
147147
$generalLocale = substr($locale, 0, $underscorePos);
148148
}

0 commit comments

Comments
 (0)