-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: fix TypeError in strict mode #8270
Merged
Merged
+21
−11
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) CodeIgniter\Commands\Database\ShowTableInfoTest::testDbTableMetadata TypeError: CodeIgniter\Commands\Database\ShowTableInfo::setYesOrNo(): Argument #1 ($fieldValue) must be of type bool, int given, called in /home/runner/work/CodeIgniter4/CodeIgniter4/system/Commands/Database/ShowTableInfo.php on line 286 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Commands/Database/ShowTableInfo.php:297 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Commands/Database/ShowTableInfo.php:286 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Commands/Database/ShowTableInfo.php:144 /home/runner/work/CodeIgniter4/CodeIgniter4/system/CLI/Commands.php:67 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Common.php:198 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Commands/Database/ShowTableInfoTest.php:98
1) CodeIgniter\Models\InsertModelTest::testInsertPermitInsertNoData TypeError: strcspn(): Argument #1 ($string) must be of type string, int given /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:1042 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:1029 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Model.php:308 /home/runner/work/CodeIgniter4/CodeIgniter4/system/BaseModel.php:782 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Model.php:707 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Models/InsertModelTest.php:255
1) CodeIgniter\Database\Live\DbUtilsTest::testUtilsCSVFromResult TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, int given /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseUtils.php:217 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/DbUtilsTest.php:186 2) CodeIgniter\Database\Live\DbUtilsTest::testUtilsXMLFromResult TypeError: xml_convert(): Argument #1 ($str) must be of type string, int given, called in /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseUtils.php on line 249 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Helpers/xml_helper.php:20 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseUtils.php:249 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/DbUtilsTest.php:199
There were 2 errors: 1) CodeIgniter\Database\Live\UpsertTest::testUpsertWithMatchingDataOnUniqueIndexandPrimaryKey TypeError: strtoupper(): Argument #1 ($string) must be of type string, int given /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/Postgre/Builder.php:364 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1790 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1927 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/UpsertTest.php:410 2) CodeIgniter\Database\Live\UpsertTest::testUpsertBatchOnPrimaryKey TypeError: strtoupper(): Argument #1 ($string) must be of type string, int given /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/Postgre/Builder.php:364 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1790 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1961 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/UpsertTest.php:457 -- There was 1 failure: 1) CodeIgniter\Database\Live\UpsertTest::testUpsertCauseConstraintError Failed asserting that exception of type "TypeError" matches expected exception "CodeIgniter\Database\Exceptions\DatabaseException". Message was: "trim(): Argument #1 ($string) must be of type string, CodeIgniter\Database\RawSql given" at /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/Postgre/Builder.php:360 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1790 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1927 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/UpsertTest.php:303
3) CodeIgniter\Database\Live\FabricatorLiveTest::testCreateAddsToDatabase TypeError: CodeIgniter\Database\SQLSRV\Connection::insertID(): Return value must be of type int, string returned /home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/SQLSRV/Connection.php:195 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Model.php:328 /home/runner/work/CodeIgniter4/CodeIgniter4/system/BaseModel.php:782 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Model.php:707 /home/runner/work/CodeIgniter4/CodeIgniter4/system/Test/Fabricator.php:475 /home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/FabricatorLiveTest.php:41
5 tasks
datamweb
approved these changes
Nov 29, 2023
paulbalandan
approved these changes
Nov 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
declare(strict_types=1)
#8072Checklist: