Skip to content

Commit 69d1438

Browse files
committed
chore: Bump structarmed to ^0.17 and enable CodeQuality preset
1 parent 322c33a commit 69d1438

8 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"psr/log": "^3.0"
1818
},
1919
"require-dev": {
20-
"boundwize/structarmed": "^0.16",
20+
"boundwize/structarmed": "^0.17",
2121
"codeigniter/phpstan-codeigniter": "^2.1",
2222
"fakerphp/faker": "^1.24",
2323
"kint-php/kint": "^6.1",

‎structarmed.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
__DIR__ . '/system/ThirdParty',
4848
])
4949
->cacheDirectory(is_dir('/tmp') ? '/tmp/structarmed' : null)
50-
->withPreset(Preset::PSR4())
50+
->withPresets(Preset::PSR4(), Preset::CODEQUALITY())
5151
// Resolve CodeIgniter layers from class names because several layers share directories.
5252
->layerPattern('API', '/^CodeIgniter\\\\API\\\\.*$/')
5353
->layerPattern('Cache', '/^CodeIgniter\\\\Cache\\\\.*$/')

‎system/Autoloader/Autoloader.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ private function autoloadKint(): void
531531
{
532532
// If we have KINT_DIR it means it's already loaded via composer
533533
if (! defined('KINT_DIR')) {
534-
spl_autoload_register(function ($class): void {
534+
spl_autoload_register(static function ($class): void {
535535
$class = explode('\\', $class);
536536

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

‎system/CodeIgniter.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private function autoloadKint(): void
261261
{
262262
// If we have KINT_DIR it means it's already loaded via composer
263263
if (! defined('KINT_DIR')) {
264-
spl_autoload_register(function ($class): void {
264+
spl_autoload_register(static function ($class): void {
265265
$class = explode('\\', $class);
266266

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

‎system/View/Cells/Cell.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ final protected function view(?string $view, array $data = []): string
111111

112112
$foundView = current($candidateViews);
113113

114-
return (function () use ($properties, $foundView): string {
114+
return (static function () use ($properties, $foundView): string {
115115
extract($properties);
116116
ob_start();
117117
include $foundView;

‎tests/system/Entity/EntityTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public function testCastDateTimeWithTimestampTimezone(): void
507507

508508
$entity = $this->getCastEntity();
509509

510-
$entity->eighth = 1722988800; // 2024-08-07 00:00:00 UTC
510+
$entity->eighth = 1_722_988_800; // 2024-08-07 00:00:00 UTC
511511

512512
$this->assertInstanceOf(Time::class, $entity->eighth);
513513
// The timezone is the default timezone, not UTC.

‎tests/system/I18n/TimeTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public function testCreateFromTimestamp(): void
290290

291291
public function testCreateFromTimestampWithMicroseconds(): void
292292
{
293-
$timestamp = 1489762800.654321;
293+
$timestamp = 1_489_762_800.654321;
294294
$locale = setlocale(LC_NUMERIC, '0');
295295

296296
setlocale(LC_NUMERIC, 'de_DE.UTF-8', 'de_DE');

‎tests/system/SuperglobalsTest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ public function testServerSetWithArray(): void
5757

5858
public function testServerSetWithInt(): void
5959
{
60-
$this->superglobals->setServer('REQUEST_TIME', 1234567890);
60+
$this->superglobals->setServer('REQUEST_TIME', 1_234_567_890);
6161

62-
$this->assertSame(1234567890, $this->superglobals->server('REQUEST_TIME'));
62+
$this->assertSame(1_234_567_890, $this->superglobals->server('REQUEST_TIME'));
6363
}
6464

6565
public function testServerSetWithFloat(): void
6666
{
67-
$this->superglobals->setServer('REQUEST_TIME_FLOAT', 1234567890.123);
67+
$this->superglobals->setServer('REQUEST_TIME_FLOAT', 1_234_567_890.123);
6868

69-
$this->assertEqualsWithDelta(1234567890.123, $this->superglobals->server('REQUEST_TIME_FLOAT'), PHP_FLOAT_EPSILON);
69+
$this->assertEqualsWithDelta(1_234_567_890.123, $this->superglobals->server('REQUEST_TIME_FLOAT'), PHP_FLOAT_EPSILON);
7070
}
7171

7272
public function testServerUnset(): void

0 commit comments

Comments
 (0)