From 107e2b3ff9f3dd63e63ca3c68355191a0dbc5d45 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Wed, 11 Dec 2024 18:41:02 +0800 Subject: [PATCH] refactor: rename `stdclass` to `stdClass` --- phpstan-baseline.php | 12 ------------ .../system/Database/Live/MySQLi/RawSqlTest.php | 18 +++++++++--------- tests/system/Database/Live/UpsertTest.php | 10 +++++----- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index b24ee06ed922..f94035013ec2 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -13105,12 +13105,6 @@ 'count' => 1, 'path' => __DIR__ . '/tests/system/Database/Live/MySQLi/NumberNativeTest.php', ]; -$ignoreErrors[] = [ - // identifier: class.nameCase - 'message' => '#^Class stdClass referenced with incorrect case\\: stdclass\\.$#', - 'count' => 9, - 'path' => __DIR__ . '/tests/system/Database/Live/MySQLi/RawSqlTest.php', -]; $ignoreErrors[] = [ // identifier: method.notFound 'message' => '#^Call to an undefined method CodeIgniter\\\\Database\\\\BaseConnection\\:\\:getCursor\\(\\)\\.$#', @@ -13195,12 +13189,6 @@ 'count' => 9, 'path' => __DIR__ . '/tests/system/Database/Live/UpsertTest.php', ]; -$ignoreErrors[] = [ - // identifier: class.nameCase - 'message' => '#^Class stdClass referenced with incorrect case\\: stdclass\\.$#', - 'count' => 5, - 'path' => __DIR__ . '/tests/system/Database/Live/UpsertTest.php', -]; $ignoreErrors[] = [ // identifier: argument.type 'message' => '#^Parameter \\#1 \\$set of method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:updateFields\\(\\) expects array\\\\|string, array\\ given\\.$#', diff --git a/tests/system/Database/Live/MySQLi/RawSqlTest.php b/tests/system/Database/Live/MySQLi/RawSqlTest.php index e136d526e2de..03c694d0ab47 100644 --- a/tests/system/Database/Live/MySQLi/RawSqlTest.php +++ b/tests/system/Database/Live/MySQLi/RawSqlTest.php @@ -17,7 +17,7 @@ use CodeIgniter\Test\CIUnitTestCase; use CodeIgniter\Test\DatabaseTestTrait; use PHPUnit\Framework\Attributes\Group; -use stdclass; +use stdClass; use Tests\Support\Database\Seeds\CITestSeeder; /** @@ -61,12 +61,12 @@ public function testRawSqlUpdateObject(): void { $data = []; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'derek@world.com'; $row->created_at = new RawSql("setDateTime('2022-01-01')"); $data[] = $row; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'ahmadinejad@world.com'; $row->created_at = new RawSql("setDateTime('2022-01-01')"); $data[] = $row; @@ -85,12 +85,12 @@ public function testRawSqlSetUpdateObject(): void { $data = []; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'derek@world.com'; $row->created_at = new RawSql("setDateTime('2022-02-01')"); $data[] = $row; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'ahmadinejad@world.com'; $row->created_at = new RawSql("setDateTime('2022-02-01')"); $data[] = $row; @@ -147,12 +147,12 @@ public function testRawSqlInsertObject(): void { $data = []; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'tony@world.com'; $row->created_at = new RawSql("setDateTime('2022-05-01')"); $data[] = $row; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'sara@world.com'; $row->created_at = new RawSql("setDateTime('2022-05-01')"); $data[] = $row; @@ -173,12 +173,12 @@ public function testRawSqlSetInsertObject(): void { $data = []; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'laura@world.com'; $row->created_at = new RawSql("setDateTime('2022-06-01')"); $data[] = $row; - $row = new stdclass(); + $row = new stdClass(); $row->email = 'travis@world.com'; $row->created_at = new RawSql("setDateTime('2022-06-01')"); $data[] = $row; diff --git a/tests/system/Database/Live/UpsertTest.php b/tests/system/Database/Live/UpsertTest.php index 94732e694d50..bb29f0802480 100644 --- a/tests/system/Database/Live/UpsertTest.php +++ b/tests/system/Database/Live/UpsertTest.php @@ -20,7 +20,7 @@ use CodeIgniter\Test\DatabaseTestTrait; use Config\Database; use PHPUnit\Framework\Attributes\Group; -use stdclass; +use stdClass; use Tests\Support\Database\Seeds\CITestSeeder; /** @@ -107,21 +107,21 @@ public function testUpsertAndUpsertBatchWithObject(): void $data = []; // new row insert - $row = new stdclass(); + $row = new stdClass(); $row->name = 'Pedro'; $row->email = 'pedro@acme.com'; $row->country = 'El Salvador'; $data[] = $row; // no change - $row = new stdclass(); + $row = new stdClass(); $row->name = 'Ahmadinejad'; $row->email = 'ahmadinejad@world.com'; $row->country = 'Iran'; $data[] = $row; // changed country for update - $row = new stdclass(); + $row = new stdClass(); $row->name = 'Derek Jones'; $row->email = 'derek@world.com'; $row->country = 'Canada'; @@ -644,7 +644,7 @@ public function testSetBatchOneRow(): void $builder->setData($moreData); } - $evenMoreData = new stdclass(); + $evenMoreData = new stdClass(); $evenMoreData->name = 'New User2 users'; $evenMoreData->email = 'newuser2@example.com'; $evenMoreData->country = 'Netherlands';