Skip to content

Commit 9b51c1a

Browse files
authored
Merge pull request #4790 from paulbalandan/blank-line-before-statement
Enable `blank_line_before_statement`
2 parents 3d1603e + 7b37453 commit 9b51c1a

File tree

129 files changed

+496
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+496
-5
lines changed

app/Views/errors/cli/error_exception.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@
5555
{
5656
case is_object($value):
5757
return 'Object(' . get_class($value) . ')';
58+
5859
case is_array($value):
5960
return count($value) ? '[...]' : '[]';
61+
6062
case is_null($value):
6163
return 'null'; // return the lowercased version
64+
6265
default:
6366
return var_export($value, true);
6467
}

app/Views/errors/html/error_exception.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
$mirror = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
9494
$params = $mirror->getParameters();
9595
}
96+
9697
foreach ($row['args'] as $key => $value) : ?>
9798
<tr>
9899
<td><code><?= esc(isset($params[$key]) ? '$' . $params[$key]->name : "#$key") ?></code></td>

spark

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ $console->showHeader($suppress);
6363

6464
// fire off the command in the main framework.
6565
$response = $console->run();
66+
6667
if ($response->getStatusCode() >= 300)
6768
{
6869
exit($response->getStatusCode());

system/Autoloader/Autoloader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ protected function discoverComposerNamespaces()
360360
}
361361

362362
$newPaths = [];
363+
363364
foreach ($paths as $key => $value)
364365
{
365366
// Composer stores namespaces with trailing slash. We don't.

system/BaseModel.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ public function save($data): bool
691691
$response = true;
692692
}
693693
}
694+
694695
return $response;
695696
}
696697

@@ -1228,6 +1229,7 @@ protected function doProtectFields(array $data): array
12281229
protected function setDate(?int $userData = null)
12291230
{
12301231
$currentDate = $userData ?? time();
1232+
12311233
return $this->intToDate($currentDate);
12321234
}
12331235

@@ -1254,10 +1256,13 @@ protected function intToDate(int $value)
12541256
{
12551257
case 'int':
12561258
return $value;
1259+
12571260
case 'datetime':
12581261
return date('Y-m-d H:i:s', $value);
1262+
12591263
case 'date':
12601264
return date('Y-m-d', $value);
1265+
12611266
default:
12621267
throw ModelException::forNoDateFormat(static::class);
12631268
}
@@ -1281,10 +1286,13 @@ protected function timeToDate(Time $value)
12811286
{
12821287
case 'datetime':
12831288
return $value->format('Y-m-d H:i:s');
1289+
12841290
case 'date':
12851291
return $value->format('Y-m-d');
1292+
12861293
case 'int':
12871294
return $value->getTimestamp();
1295+
12881296
default:
12891297
return (string) $value;
12901298
}
@@ -1599,6 +1607,7 @@ protected function objectToArray($data, bool $onlyChanged = true, bool $recursiv
15991607
{
16001608
return $this->timeToDate($value);
16011609
}
1610+
16021611
return $value;
16031612
}, $properties);
16041613
}
@@ -1723,6 +1732,7 @@ public function __isset(string $name): bool
17231732
{
17241733
return true;
17251734
}
1735+
17261736
return isset($this->db->$name);
17271737
}
17281738

system/CLI/CLI.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ public static function wait(int $seconds, bool $countdown = false)
417417
if ($countdown === true)
418418
{
419419
$time = $seconds;
420+
420421
while ($time > 0)
421422
{
422423
static::fwrite(STDOUT, $time . '... ');
@@ -1082,6 +1083,7 @@ public static function table(array $tbody, array $thead = [])
10821083
for ($row = 0; $row < $totalRows; $row ++)
10831084
{
10841085
$column = 0; // Current column index
1086+
10851087
foreach ($tableRows[$row] as $col)
10861088
{
10871089
// Sets the size of this column in the current row
@@ -1105,6 +1107,7 @@ public static function table(array $tbody, array $thead = [])
11051107
for ($row = 0; $row < $totalRows; $row ++)
11061108
{
11071109
$column = 0;
1110+
11081111
foreach ($tableRows[$row] as $col)
11091112
{
11101113
$diff = $maxColsLengths[$column] - static::strlen($col);
@@ -1125,6 +1128,7 @@ public static function table(array $tbody, array $thead = [])
11251128
if ($row === 0)
11261129
{
11271130
$cols = '+';
1131+
11281132
foreach ($tableRows[$row] as $col)
11291133
{
11301134
$cols .= str_repeat('-', static::strlen($col) + 2) . '+';
@@ -1166,6 +1170,7 @@ protected static function fwrite($handle, string $string)
11661170
{
11671171
// @codeCoverageIgnoreStart
11681172
echo $string;
1173+
11691174
return;
11701175
// @codeCoverageIgnoreEnd
11711176
}

system/Cache/Handlers/FileHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,24 +519,31 @@ protected function getFileInfo(string $file, $returnedValues = ['name', 'server_
519519
case 'name':
520520
$fileInfo['name'] = basename($file);
521521
break;
522+
522523
case 'server_path':
523524
$fileInfo['server_path'] = $file;
524525
break;
526+
525527
case 'size':
526528
$fileInfo['size'] = filesize($file);
527529
break;
530+
528531
case 'date':
529532
$fileInfo['date'] = filemtime($file);
530533
break;
534+
531535
case 'readable':
532536
$fileInfo['readable'] = is_readable($file);
533537
break;
538+
534539
case 'writable':
535540
$fileInfo['writable'] = is_writable($file);
536541
break;
542+
537543
case 'executable':
538544
$fileInfo['executable'] = is_executable($file);
539545
break;
546+
540547
case 'fileperms':
541548
$fileInfo['fileperms'] = fileperms($file);
542549
break;

system/Cache/Handlers/PredisHandler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ public function get(string $key)
113113
case 'array':
114114
case 'object':
115115
return unserialize($data['__ci_value']);
116+
116117
case 'boolean':
117118
case 'integer':
118119
case 'double': // Yes, 'double' is returned and NOT 'float'
119120
case 'string':
120121
case 'NULL':
121122
return settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null;
123+
122124
case 'resource':
123125
default:
124126
return null;
@@ -146,12 +148,14 @@ public function save(string $key, $value, int $ttl = 60)
146148
case 'object':
147149
$value = serialize($value);
148150
break;
151+
149152
case 'boolean':
150153
case 'integer':
151154
case 'double': // Yes, 'double' is returned and NOT 'float'
152155
case 'string':
153156
case 'NULL':
154157
break;
158+
155159
case 'resource':
156160
default:
157161
return false;

system/Cache/Handlers/RedisHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,21 @@ public function initialize()
9393
{
9494
// Note:: I'm unsure if log_message() is necessary, however I'm not 100% comfortable removing it.
9595
log_message('error', 'Cache: Redis connection failed. Check your configuration.');
96+
9697
throw new CriticalError('Cache: Redis connection failed. Check your configuration.');
9798
}
9899

99100
if (isset($config['password']) && ! $this->redis->auth($config['password']))
100101
{
101102
log_message('error', 'Cache: Redis authentication failed.');
103+
102104
throw new CriticalError('Cache: Redis authentication failed.');
103105
}
104106

105107
if (isset($config['database']) && ! $this->redis->select($config['database']))
106108
{
107109
log_message('error', 'Cache: Redis select database failed.');
110+
108111
throw new CriticalError('Cache: Redis select database failed.');
109112
}
110113
}
@@ -140,12 +143,14 @@ public function get(string $key)
140143
case 'array':
141144
case 'object':
142145
return unserialize($data['__ci_value']);
146+
143147
case 'boolean':
144148
case 'integer':
145149
case 'double': // Yes, 'double' is returned and NOT 'float'
146150
case 'string':
147151
case 'NULL':
148152
return settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null;
153+
149154
case 'resource':
150155
default:
151156
return null;
@@ -173,12 +178,14 @@ public function save(string $key, $value, int $ttl = 60)
173178
case 'object':
174179
$value = serialize($value);
175180
break;
181+
176182
case 'boolean':
177183
case 'integer':
178184
case 'double': // Yes, 'double' is returned and NOT 'float'
179185
case 'string':
180186
case 'NULL':
181187
break;
188+
182189
case 'resource':
183190
default:
184191
return false;

system/CodeIgniter.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ public function run(RouteCollectionInterface $routes = null, bool $returnRespons
328328

329329
$this->response->pretend($this->useSafeOutput)->send();
330330
$this->callExit(EXIT_SUCCESS);
331+
331332
return;
332333
}
333334

@@ -346,6 +347,7 @@ public function run(RouteCollectionInterface $routes = null, bool $returnRespons
346347
$this->sendResponse();
347348

348349
$this->callExit(EXIT_SUCCESS);
350+
349351
return;
350352
}
351353
catch (PageNotFoundException $e)
@@ -526,6 +528,7 @@ protected function bootstrapEnvironment()
526528
// @codeCoverageIgnoreStart
527529
header('HTTP/1.1 503 Service Unavailable.', true, 503);
528530
echo 'The application environment is not set correctly.';
531+
529532
exit(EXIT_ERROR); // EXIT_ERROR
530533
// @codeCoverageIgnoreEnd
531534
}
@@ -707,6 +710,7 @@ public static function cache(int $time)
707710
public function cachePage(Cache $config)
708711
{
709712
$headers = [];
713+
710714
foreach ($this->response->headers() as $header)
711715
{
712716
$headers[$header->getName()] = $header->getValueLine();
@@ -872,6 +876,7 @@ protected function startController()
872876
if (is_object($this->controller) && (get_class($this->controller) === 'Closure'))
873877
{
874878
$controller = $this->controller;
879+
875880
return $controller(...$this->router->params());
876881
}
877882

@@ -1014,6 +1019,7 @@ protected function gatherOutput(Cache $cacheConfig = null, $returned = null)
10141019
if ($returned instanceof DownloadResponse)
10151020
{
10161021
$this->response = $returned;
1022+
10171023
return;
10181024
}
10191025
// If the controller returned a response object,

system/Commands/Database/CreateDatabase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public function run(array $params)
142142
// @codeCoverageIgnoreStart
143143
CLI::error('Database creation failed.', 'light_gray', 'red');
144144
CLI::newLine();
145+
145146
return;
146147
// @codeCoverageIgnoreEnd
147148
}
@@ -151,6 +152,7 @@ public function run(array $params)
151152
// @codeCoverageIgnoreStart
152153
CLI::error('Database creation failed.', 'light_gray', 'red');
153154
CLI::newLine();
155+
154156
return;
155157
// @codeCoverageIgnoreEnd
156158
}

system/Commands/Encryption/GenerateKey.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ public function run(array $params)
9494
{
9595
CLI::write($encodedKey, 'yellow');
9696
CLI::newLine();
97+
9798
return;
9899
}
99100

100101
if (! $this->setNewEncryptionKey($encodedKey, $params))
101102
{
102103
CLI::write('Error in setting new encryption key to .env file.', 'light_gray', 'red');
103104
CLI::newLine();
105+
104106
return;
105107
}
106108

@@ -189,6 +191,7 @@ protected function writeNewEncryptionKeyToFile(string $oldKey, string $newKey):
189191
CLI::write('Both default shipped `env` file and custom `.env` are missing.', 'yellow');
190192
CLI::write('Here\'s your new key instead: ' . CLI::color($newKey, 'yellow'));
191193
CLI::newLine();
194+
192195
return false;
193196
}
194197

system/Commands/Housekeeping/ClearDebugbar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function run(array $params)
6464
// @codeCoverageIgnoreStart
6565
CLI::error('Error deleting the debugbar JSON files.');
6666
CLI::newLine();
67+
6768
return;
6869
// @codeCoverageIgnoreEnd
6970
}

system/Commands/Housekeeping/ClearLogs.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function run(array $params)
7272
CLI::error('Deleting logs aborted.', 'light_gray', 'red');
7373
CLI::error('If you want, use the "-force" option to force delete all log files.', 'light_gray', 'red');
7474
CLI::newLine();
75+
7576
return;
7677
// @codeCoverageIgnoreEnd
7778
}
@@ -83,6 +84,7 @@ public function run(array $params)
8384
// @codeCoverageIgnoreStart
8485
CLI::error('Error in deleting the logs files.', 'light_gray', 'red');
8586
CLI::newLine();
87+
8688
return;
8789
// @codeCoverageIgnoreEnd
8890
}

system/Commands/ListCommands.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ protected function listFull(array $commands)
113113
foreach ($groups as $group => $commands)
114114
{
115115
CLI::write($group, 'yellow');
116+
116117
foreach ($commands as $name => $command)
117118
{
118119
$name = $this->setPad($name, $length, 2, 2);

system/Commands/Utilities/Namespaces.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public function run(array $params)
7777
$config = new Autoload();
7878

7979
$tbody = [];
80+
8081
foreach ($config->psr4 as $ns => $path)
8182
{
8283
$path = realpath($path) ?: $path;

system/Commands/Utilities/Routes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function run(array $params)
8989
];
9090

9191
$tbody = [];
92+
9293
foreach ($methods as $method)
9394
{
9495
$routes = $collection->getRoutes($method);

0 commit comments

Comments
 (0)