Skip to content

Commit 83820a8

Browse files
committed
Enable blank_line_before_statement
1 parent d028ec4 commit 83820a8

File tree

157 files changed

+818
-1
lines changed

Some content is hidden

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

157 files changed

+818
-1
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/Autoloader/FileLocator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function locateFile(string $file, string $folder = null, string $ext = 'p
9292
$paths = $namespaces[$prefix];
9393

9494
$filename = implode('/', $segments);
95+
9596
break;
9697
}
9798

@@ -116,6 +117,7 @@ public function locateFile(string $file, string $folder = null, string $ext = 'p
116117
}
117118

118119
$path .= $filename;
120+
119121
if (is_file($path))
120122
{
121123
return $path;
@@ -153,6 +155,7 @@ public function getClassname(string $file) : string
153155
{
154156
$namespace = 0;
155157
}
158+
156159
if (isset($token[1]))
157160
{
158161
$namespace = $namespace ? $namespace . '\\' . $token[1] : $token[1];
@@ -169,6 +172,7 @@ public function getClassname(string $file) : string
169172
&& $token[0] === T_STRING)
170173
{
171174
$className = $token[1];
175+
172176
break;
173177
}
174178
}

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
}
@@ -1728,6 +1737,7 @@ public function __isset(string $name): bool
17281737
{
17291738
return true;
17301739
}
1740+
17311741
return isset($this->db->$name);
17321742
}
17331743

system/CLI/CLI.php

Lines changed: 6 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 . '... ');
@@ -1087,6 +1088,7 @@ public static function table(array $tbody, array $thead = [])
10871088
for ($row = 0; $row < $totalRows; $row ++)
10881089
{
10891090
$column = 0; // Current column index
1091+
10901092
foreach ($tableRows[$row] as $col)
10911093
{
10921094
// Sets the size of this column in the current row
@@ -1110,9 +1112,11 @@ public static function table(array $tbody, array $thead = [])
11101112
for ($row = 0; $row < $totalRows; $row ++)
11111113
{
11121114
$column = 0;
1115+
11131116
foreach ($tableRows[$row] as $col)
11141117
{
11151118
$diff = $maxColsLengths[$column] - static::strlen($col);
1119+
11161120
if ($diff)
11171121
{
11181122
$tableRows[$row][$column] = $tableRows[$row][$column] . str_repeat(' ', $diff);
@@ -1130,6 +1134,7 @@ public static function table(array $tbody, array $thead = [])
11301134
if ($row === 0)
11311135
{
11321136
$cols = '+';
1137+
11331138
foreach ($tableRows[$row] as $col)
11341139
{
11351140
$cols .= str_repeat('-', static::strlen($col) + 2) . '+';
@@ -1171,6 +1176,7 @@ protected static function fwrite($handle, string $string)
11711176
{
11721177
// @codeCoverageIgnoreStart
11731178
echo $string;
1179+
11741180
return;
11751181
// @codeCoverageIgnoreEnd
11761182
}

system/Cache/Handlers/BaseHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ public static function validateKey($key, $prefix = ''): string
5656
{
5757
throw new InvalidArgumentException('Cache key must be a string');
5858
}
59+
5960
if ($key === '')
6061
{
6162
throw new InvalidArgumentException('Cache key cannot be empty.');
6263
}
64+
6365
if (strpbrk($key, self::RESERVED_CHARACTERS) !== false)
6466
{
6567
throw new InvalidArgumentException('Cache key contains reserved characters ' . self::RESERVED_CHARACTERS);

system/Cache/Handlers/FileHandler.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ protected function getItem(string $filename)
327327
}
328328

329329
$data = @unserialize(file_get_contents($this->path . $filename));
330+
330331
if (! is_array($data) || ! isset($data['ttl']))
331332
{
332333
return false;
@@ -518,27 +519,42 @@ protected function getFileInfo(string $file, $returnedValues = ['name', 'server_
518519
{
519520
case 'name':
520521
$fileInfo['name'] = basename($file);
522+
521523
break;
524+
522525
case 'server_path':
523526
$fileInfo['server_path'] = $file;
527+
524528
break;
529+
525530
case 'size':
526531
$fileInfo['size'] = filesize($file);
532+
527533
break;
534+
528535
case 'date':
529536
$fileInfo['date'] = filemtime($file);
537+
530538
break;
539+
531540
case 'readable':
532541
$fileInfo['readable'] = is_readable($file);
542+
533543
break;
544+
534545
case 'writable':
535546
$fileInfo['writable'] = is_writable($file);
547+
536548
break;
549+
537550
case 'executable':
538551
$fileInfo['executable'] = is_executable($file);
552+
539553
break;
554+
540555
case 'fileperms':
541556
$fileInfo['fileperms'] = fileperms($file);
557+
542558
break;
543559
}
544560
}

system/Cache/Handlers/MemcachedHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public function initialize()
9090
{
9191
// Create new instance of Memcached
9292
$this->memcached = new Memcached();
93+
9394
if ($this->config['raw'])
9495
{
9596
$this->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true);

system/Cache/Handlers/PredisHandler.php

Lines changed: 5 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;
@@ -145,13 +147,16 @@ public function save(string $key, $value, int $ttl = 60)
145147
case 'array':
146148
case 'object':
147149
$value = serialize($value);
150+
148151
break;
152+
149153
case 'boolean':
150154
case 'integer':
151155
case 'double': // Yes, 'double' is returned and NOT 'float'
152156
case 'string':
153157
case 'NULL':
154158
break;
159+
155160
case 'resource':
156161
default:
157162
return false;

system/Cache/Handlers/RedisHandler.php

Lines changed: 8 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;
@@ -172,13 +177,16 @@ public function save(string $key, $value, int $ttl = 60)
172177
case 'array':
173178
case 'object':
174179
$value = serialize($value);
180+
175181
break;
182+
176183
case 'boolean':
177184
case 'integer':
178185
case 'double': // Yes, 'double' is returned and NOT 'float'
179186
case 'string':
180187
case 'NULL':
181188
break;
189+
182190
case 'resource':
183191
default:
184192
return false;

0 commit comments

Comments
 (0)