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: fix TypeError in strict mode #8270

Merged
merged 6 commits into from
Nov 30, 2023

Commits on Nov 29, 2023

  1. refactor: fix TypeError in ShowTableInfo::setYesOrNo()

    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
    kenjis committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    ef2ba3e View commit details
    Browse the repository at this point in the history
  2. refactor: fix TypeError in BaseConnection

    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
    kenjis committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    0ee570c View commit details
    Browse the repository at this point in the history
  3. refactor: fix TypeError in BaseUtils

    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
    kenjis committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    b7deefa View commit details
    Browse the repository at this point in the history
  4. refactor: fix TypeError in Postgre/Builder.php

    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
    kenjis committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    6f70eca View commit details
    Browse the repository at this point in the history
  5. refactor: fix TypeError in SQLSRV/Connection.php

    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
    kenjis committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    54d7c65 View commit details
    Browse the repository at this point in the history
  6. style: break long line

    kenjis committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    18582cc View commit details
    Browse the repository at this point in the history