From 3882bc82665f8eb1dec510eec7464586ab5eef28 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 20 Oct 2025 21:23:58 +0700 Subject: [PATCH 1/2] refactor: apply code quality level 61 for Rector --- rector.php | 2 +- system/Database/MigrationRunner.php | 4 +--- system/Pager/PagerRenderer.php | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/rector.php b/rector.php index 73d0ecb2cfc3..dea282d17bef 100644 --- a/rector.php +++ b/rector.php @@ -202,4 +202,4 @@ // keep '\\' prefix string on string '\Foo\Bar' StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true, ]) - ->withCodeQualityLevel(58); + ->withCodeQualityLevel(61); diff --git a/system/Database/MigrationRunner.php b/system/Database/MigrationRunner.php index 8f723924539f..01c4e5ff64ad 100644 --- a/system/Database/MigrationRunner.php +++ b/system/Database/MigrationRunner.php @@ -47,7 +47,7 @@ class MigrationRunner * * @var string|null */ - protected $namespace; + protected $namespace = APP_NAMESPACE; /** * The database Group to migrate. @@ -136,8 +136,6 @@ public function __construct(MigrationsConfig $config, $db = null) $this->enabled = $config->enabled ?? false; $this->table = $config->table ?? 'migrations'; - $this->namespace = APP_NAMESPACE; - // Even if a DB connection is passed, since it is a test, // it is assumed to use the default group name $this->group = is_string($db) ? $db : config(Database::class)->defaultGroup; diff --git a/system/Pager/PagerRenderer.php b/system/Pager/PagerRenderer.php index 2352a98460e3..8e550137b2da 100644 --- a/system/Pager/PagerRenderer.php +++ b/system/Pager/PagerRenderer.php @@ -29,9 +29,12 @@ class PagerRenderer /** * First page number in the set of links to be displayed. * + * `first` and `last` will be updated by `setSurroundCount()`. + * You must call `setSurroundCount()` after instantiation. + * * @var int */ - protected $first; + protected $first = 1; /** * Last page number in the set of links to be displayed. @@ -102,9 +105,6 @@ class PagerRenderer */ public function __construct(array $details) { - // `first` and `last` will be updated by `setSurroundCount()`. - // You must call `setSurroundCount()` after instantiation. - $this->first = 1; $this->last = $details['pageCount']; $this->current = $details['currentPage']; From c37e3e1ad3fa8fd6917696398ae4ea2da6dd1fca Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 20 Oct 2025 21:26:13 +0700 Subject: [PATCH 2/2] refactor: cs fix --- system/Pager/PagerRenderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Pager/PagerRenderer.php b/system/Pager/PagerRenderer.php index 8e550137b2da..f970ee551f19 100644 --- a/system/Pager/PagerRenderer.php +++ b/system/Pager/PagerRenderer.php @@ -105,7 +105,7 @@ class PagerRenderer */ public function __construct(array $details) { - $this->last = $details['pageCount']; + $this->last = $details['pageCount']; $this->current = $details['currentPage']; $this->total = $details['total'];