Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename stdclass to stdClass #9312

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = '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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
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 @@
$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';
Expand Down Expand Up @@ -644,7 +644,7 @@
$builder->setData($moreData);
}

$evenMoreData = new stdclass();
$evenMoreData = new stdClass();
$evenMoreData->name = 'New User2 users';
$evenMoreData->email = 'newuser2@example.com';
$evenMoreData->country = 'Netherlands';
Expand Down Expand Up @@ -711,7 +711,7 @@
$this->assertStringContainsString('upsertone@test.com', $sql);
}

public function testUpsertBatchWithQuery(): void

Check warning on line 714 in tests/system/Database/Live/UpsertTest.php

View workflow job for this annotation

GitHub Actions / DatabaseLive (8.2, OCI8, 8.0) / tests

Took 0.9208s from 0.5000s limit to run CodeIgniter\\Database\\Live\\UpsertTest::testUpsertBatchWithQuery
{
$this->forge = Database::forge($this->DBGroup);

Expand Down
Loading