Skip to content

Commit 54f8580

Browse files
committed
Chore: updates by php-cs-fixer and rector
1 parent 94a3bc9 commit 54f8580

File tree

9 files changed

+17
-19
lines changed

9 files changed

+17
-19
lines changed

src/Auth/Actions/EmailActivator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use CodeIgniter\Exceptions\PageNotFoundException;
99
use CodeIgniter\HTTP\IncomingRequest;
1010
use CodeIgniter\HTTP\RedirectResponse;
11-
use CodeIgniter\HTTP\Response;
1211
use CodeIgniter\I18n\Time;
1312
use CodeIgniter\Shield\Authentication\Actions\EmailActivator as ShieldEmailActivator;
1413
use CodeIgniter\Shield\Authentication\Authenticators\Session;

src/Core/Namespaces.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public static function register(): void
5252
// Insert the namespaces into the psr4 array in the autoloader
5353
// to ensure that Bonfire's files get loader prior to vendor files
5454
$rp = new ReflectionProperty($autoloader, 'prefixes');
55-
$rp->setAccessible(true);
5655

5756
$prefixes = $rp->getValue($autoloader);
5857
$keys = array_keys($prefixes);

src/Core/Traits/HasMeta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function syncMeta(array $post): void
236236
}
237237

238238
foreach (array_keys($fields) as $field) {
239-
$field = strtolower($field);
239+
$field = strtolower((string) $field);
240240
$existing = array_key_exists($field, $this->meta);
241241
// add to keep list
242242
$legal[] = $field;

src/Menus/MenuItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function __construct(?array $data = null)
8484
}
8585

8686
foreach ($data as $key => $value) {
87-
$method = 'set' . ucfirst($key);
87+
$method = 'set' . ucfirst((string) $key);
8888
if (method_exists($this, $method)) {
8989
$this->{$method}($value);
9090
}

src/Tools/Libraries/Logs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function countLogLevels($filePath): string
118118

119119
// Count occurrences of each level
120120
foreach ($levels as $level) {
121-
$counts[$level] = substr_count($fileContent, $level);
121+
$counts[$level] = substr_count($fileContent, (string) $level);
122122
}
123123

124124
// Remove entries with value 0

src/Widgets/Types/Charts/ChartDataset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(?array $data = null)
4848
}
4949

5050
foreach ($data as $key => $value) {
51-
$method = 'set' . ucfirst($key);
51+
$method = 'set' . ucfirst((string) $key);
5252
if (method_exists($this, $method)) {
5353
$this->{$method}($value);
5454
}

src/Widgets/Types/Charts/ChartsItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function __construct(?array $data = null)
115115
}
116116

117117
foreach ($data as $key => $value) {
118-
$method = 'set' . ucfirst($key);
118+
$method = 'set' . ucfirst((string) $key);
119119
if (method_exists($this, $method)) {
120120
$this->{$method}($value);
121121
}

src/Widgets/Types/Stats/StatsItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function __construct(?array $data = null)
9090
}
9191

9292
foreach ($data as $key => $value) {
93-
$method = 'set' . ucfirst($key);
93+
$method = 'set' . ucfirst((string) $key);
9494
if (method_exists($this, $method)) {
9595
$this->{$method}($value);
9696
}

tests/CommonTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ public static function setUpBeforeClass(): void
1818
helper('setting');
1919
}
2020

21-
public static function provideAppDate(): iterable
22-
{
23-
return [
24-
['m/d/Y', 'g:i A', false, '01/15/2021'],
25-
['m/d/Y', 'g:i A', true, '01/15/2021 3:32 PM'],
26-
['m/d/Y', 'H:i', true, '01/15/2021 15:32'],
27-
['d/m/Y', 'g:i A', false, '15/01/2021'],
28-
['M j, Y', 'g:i A', false, 'Jan 15, 2021'],
29-
];
30-
}
31-
3221
#[DataProvider('provideAppDate')]
3322
public function testAppDate(string $format, string $timeFormat, bool $includeTime, string $expected)
3423
{
@@ -40,4 +29,15 @@ public function testAppDate(string $format, string $timeFormat, bool $includeTim
4029

4130
$this->assertSame($expected, \app_date($time, $includeTime));
4231
}
32+
33+
public static function provideAppDate(): iterable
34+
{
35+
return [
36+
['m/d/Y', 'g:i A', false, '01/15/2021'],
37+
['m/d/Y', 'g:i A', true, '01/15/2021 3:32 PM'],
38+
['m/d/Y', 'H:i', true, '01/15/2021 15:32'],
39+
['d/m/Y', 'g:i A', false, '15/01/2021'],
40+
['M j, Y', 'g:i A', false, 'Jan 15, 2021'],
41+
];
42+
}
4343
}

0 commit comments

Comments
 (0)