Skip to content

Commit

Permalink
Merge pull request #9312 from paulbalandan/rename-stdclass-to-stdClass
Browse files Browse the repository at this point in the history
refactor: rename `stdclass` to `stdClass`
  • Loading branch information
samsonasik authored Dec 11, 2024
2 parents 539436f + 107e2b3 commit be824e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 26 deletions.
12 changes: 0 additions & 12 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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\\(\\)\\.$#',
Expand Down Expand Up @@ -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\\<int, CodeIgniter\\\\Database\\\\RawSql\\|string\\>\\|string, array\\<string, CodeIgniter\\\\Database\\\\RawSql\\> given\\.$#',
Expand Down
18 changes: 9 additions & 9 deletions tests/system/Database/Live/MySQLi/RawSqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -61,12 +61,12 @@ public function testRawSqlUpdateObject(): void
{
$data = [];

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-01-01')");
$data[] = $row;

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-01-01')");
$data[] = $row;
Expand All @@ -85,12 +85,12 @@ public function testRawSqlSetUpdateObject(): void
{
$data = [];

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-02-01')");
$data[] = $row;

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-02-01')");
$data[] = $row;
Expand Down Expand Up @@ -147,12 +147,12 @@ public function testRawSqlInsertObject(): void
{
$data = [];

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-05-01')");
$data[] = $row;

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-05-01')");
$data[] = $row;
Expand All @@ -173,12 +173,12 @@ public function testRawSqlSetInsertObject(): void
{
$data = [];

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-06-01')");
$data[] = $row;

$row = new stdclass();
$row = new stdClass();
$row->email = '[email protected]';
$row->created_at = new RawSql("setDateTime('2022-06-01')");
$data[] = $row;
Expand Down
10 changes: 5 additions & 5 deletions tests/system/Database/Live/UpsertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -107,21 +107,21 @@ public function testUpsertAndUpsertBatchWithObject(): void
$data = [];

// new row insert
$row = new stdclass();
$row = new stdClass();
$row->name = 'Pedro';
$row->email = '[email protected]';
$row->country = 'El Salvador';
$data[] = $row;

// no change
$row = new stdclass();
$row = new stdClass();
$row->name = 'Ahmadinejad';
$row->email = '[email protected]';
$row->country = 'Iran';
$data[] = $row;

// changed country for update
$row = new stdclass();
$row = new stdClass();
$row->name = 'Derek Jones';
$row->email = '[email protected]';
$row->country = 'Canada';
Expand Down Expand Up @@ -644,7 +644,7 @@ public function testSetBatchOneRow(): void
$builder->setData($moreData);
}

$evenMoreData = new stdclass();
$evenMoreData = new stdClass();
$evenMoreData->name = 'New User2 users';
$evenMoreData->email = '[email protected]';
$evenMoreData->country = 'Netherlands';
Expand Down

0 comments on commit be824e3

Please sign in to comment.