Skip to content

Commit 336e078

Browse files
committed
Release v4.5.4
1 parent be27314 commit 336e078

Some content is hidden

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

44 files changed

+134
-96
lines changed

app/Config/Events.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Events::on('create', [$myInstance, 'myMethod']);
2424
*/
2525

26-
Events::on('pre_system', static function () {
26+
Events::on('pre_system', static function (): void {
2727
if (ENVIRONMENT !== 'testing') {
2828
if (ini_get('zlib.output_compression')) {
2929
throw FrameworkException::forEnabledZlibOutputCompression();
@@ -47,7 +47,7 @@
4747
Services::toolbar()->respond();
4848
// Hot Reload route - for framework use on the hot reloader.
4949
if (ENVIRONMENT === 'development') {
50-
Services::routes()->get('__hot-reload', static function () {
50+
Services::routes()->get('__hot-reload', static function (): void {
5151
(new HotReloader())->run();
5252
});
5353
}

system/Autoloader/Autoloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ private function autoloadKint(): void
507507
{
508508
// If we have KINT_DIR it means it's already loaded via composer
509509
if (! defined('KINT_DIR')) {
510-
spl_autoload_register(function ($class) {
510+
spl_autoload_register(function ($class): void {
511511
$class = explode('\\', $class);
512512

513513
if (array_shift($class) !== 'Kint') {

system/CLI/BaseCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function showHelp()
163163
if ($this->arguments !== []) {
164164
CLI::newLine();
165165
CLI::write(lang('CLI.helpArguments'), 'yellow');
166-
$length = max(array_map('strlen', array_keys($this->arguments)));
166+
$length = max(array_map(strlen(...), array_keys($this->arguments)));
167167

168168
foreach ($this->arguments as $argument => $description) {
169169
CLI::write(CLI::color($this->setPad($argument, $length, 2, 2), 'green') . $description);
@@ -173,7 +173,7 @@ public function showHelp()
173173
if ($this->options !== []) {
174174
CLI::newLine();
175175
CLI::write(lang('CLI.helpOptions'), 'yellow');
176-
$length = max(array_map('strlen', array_keys($this->options)));
176+
$length = max(array_map(strlen(...), array_keys($this->options)));
177177

178178
foreach ($this->options as $option => $description) {
179179
CLI::write(CLI::color($this->setPad($option, $length, 2, 2), 'green') . $description);

system/CLI/CLI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ private static function isZeroOptions(array $options): void
393393
private static function printKeysAndValues(array $options): void
394394
{
395395
// +2 for the square brackets around the key
396-
$keyMaxLength = max(array_map('mb_strwidth', array_keys($options))) + 2;
396+
$keyMaxLength = max(array_map(mb_strwidth(...), array_keys($options))) + 2;
397397

398398
foreach ($options as $key => $description) {
399399
$name = str_pad(' [' . $key . '] ', $keyMaxLength + 4, ' ');
@@ -857,7 +857,7 @@ public static function wrap(?string $string = null, int $max = 0, int $padLeft =
857857

858858
$first = true;
859859

860-
array_walk($lines, static function (&$line) use ($padLeft, &$first) {
860+
array_walk($lines, static function (&$line) use ($padLeft, &$first): void {
861861
if (! $first) {
862862
$line = str_repeat(' ', $padLeft) . $line;
863863
} else {

system/CLI/GeneratorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ private function normalizeInputClassName(): string
325325
implode(
326326
'\\',
327327
array_map(
328-
'pascalize',
328+
pascalize(...),
329329
explode('\\', str_replace('/', '\\', trim($class)))
330330
)
331331
),

system/CodeIgniter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CodeIgniter
5656
/**
5757
* The current version of CodeIgniter Framework
5858
*/
59-
public const CI_VERSION = '4.5.3';
59+
public const CI_VERSION = '4.5.4';
6060

6161
/**
6262
* App startup time.
@@ -253,7 +253,7 @@ private function autoloadKint(): void
253253
{
254254
// If we have KINT_DIR it means it's already loaded via composer
255255
if (! defined('KINT_DIR')) {
256-
spl_autoload_register(function ($class) {
256+
spl_autoload_register(function ($class): void {
257257
$class = explode('\\', $class);
258258

259259
if (array_shift($class) !== 'Kint') {

system/Commands/ListCommands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function listFull(array $commands)
101101
$groups[$command['group']][$title] = $command;
102102
}
103103

104-
$length = max(array_map('strlen', array_keys($commands)));
104+
$length = max(array_map(strlen(...), array_keys($commands)));
105105

106106
ksort($groups);
107107

system/Commands/Utilities/Routes.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ public function run(array $params)
119119
$route['route'],
120120
$routeName,
121121
$route['handler'],
122-
implode(' ', array_map('class_basename', $filters['before'])),
123-
implode(' ', array_map('class_basename', $filters['after'])),
122+
implode(' ', array_map(class_basename(...), $filters['before'])),
123+
implode(' ', array_map(class_basename(...), $filters['after'])),
124124
];
125125
}
126126

@@ -166,8 +166,8 @@ public function run(array $params)
166166
// There is no `AUTO` method, but it is intentional not to get route filters.
167167
$filters = $filterCollector->get('AUTO', $uriGenerator->get($routes[1]));
168168

169-
$routes[] = implode(' ', array_map('class_basename', $filters['before']));
170-
$routes[] = implode(' ', array_map('class_basename', $filters['after']));
169+
$routes[] = implode(' ', array_map(class_basename(...), $filters['before']));
170+
$routes[] = implode(' ', array_map(class_basename(...), $filters['after']));
171171
}
172172
}
173173

system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ private function addFilters($routes)
125125
$filters['before'] = array_intersect($filtersLongest['before'], $filtersShortest['before']);
126126
$filters['after'] = array_intersect($filtersLongest['after'], $filtersShortest['after']);
127127

128-
$route['before'] = implode(' ', array_map('class_basename', $filters['before']));
129-
$route['after'] = implode(' ', array_map('class_basename', $filters['after']));
128+
$route['before'] = implode(' ', array_map(class_basename(...), $filters['before']));
129+
$route['after'] = implode(' ', array_map(class_basename(...), $filters['after']));
130130
}
131131

132132
return $routes;

system/Common.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,10 +766,8 @@ function lang(string $line, array $args = [], ?string $locale = null)
766766
* - notice
767767
* - info
768768
* - debug
769-
*
770-
* @return void
771769
*/
772-
function log_message(string $level, string $message, array $context = [])
770+
function log_message(string $level, string $message, array $context = []): void
773771
{
774772
// When running tests, we want to always ensure that the
775773
// TestLogger is running, which provides utilities for

0 commit comments

Comments
 (0)