Skip to content
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"phpunit/phpcov": "^9.0.2 || ^10.0",
"phpunit/phpunit": "^10.5.16 || ^11.2",
"predis/predis": "^3.0",
"rector/rector": "2.3.5",
"rector/rector": "2.3.6",
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
},
"replace": {
Expand Down
5 changes: 5 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
use Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
Expand Down Expand Up @@ -194,6 +195,10 @@
__DIR__ . '/tests/system/Database',
__DIR__ . '/tests/system/Models',
],

StaticCallOnNonStaticToInstanceCallRector::class => [
__DIR__ . '/tests/_support/Config/Services.php',
],
])
// auto import fully qualified class names
->withImportNames(removeUnusedImports: true)
Expand Down
4 changes: 2 additions & 2 deletions tests/system/API/ResponseTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ public function testPaginateWithModel(): void
public function testPaginateWithQueryBuilder(): void
{
// Mock the database and builder
$db = $this->createMock(BaseConnection::class);
$db = $this->createStub(BaseConnection::class);

$builder = $this->getMockBuilder(BaseBuilder::class)
->setConstructorArgs(['test_table', $db])
Expand Down Expand Up @@ -1100,7 +1100,7 @@ public function testPaginateWithTransformerAndQueryBuilder(): void
];

// Mock the database and builder
$db = $this->createMock(BaseConnection::class);
$db = $this->createStub(BaseConnection::class);

$builder = $this->getMockBuilder(BaseBuilder::class)
->setConstructorArgs(['test_table', $db])
Expand Down
2 changes: 2 additions & 0 deletions tests/system/Models/SaveModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Tests\Support\Models\EntityModel;
use Tests\Support\Models\JobModel;
use Tests\Support\Models\SecondaryModel;
use Tests\Support\Models\SimpleEntity;
use Tests\Support\Models\UserModel;
use Tests\Support\Models\ValidModel;
use Tests\Support\Models\WithoutAutoIncrementModel;
Expand Down Expand Up @@ -173,6 +174,7 @@ public function testSelectAndEntitiesSaveOnlyChangedValues(): void
$this->assertSame('Rocket Scientist', $job->name);

$job->description = 'Some guitar description';
$this->assertInstanceOf(SimpleEntity::class, $job);
$this->model->save($job);
$this->seeInDatabase('job', [
'id' => $job->id,
Expand Down
1 change: 1 addition & 0 deletions tests/system/Models/UpdateModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ public function testUpdateEntityUpdateOnlyChangedFalse(): void

$user = $model->find(1);
$updateAtBefore = $user->updated_at;
$this->assertInstanceOf(User::class, $user);

// updates the Entity without changes.
$result = $model->update(1, $user);
Expand Down
28 changes: 14 additions & 14 deletions utils/phpstan-baseline/missingType.property.neon
Original file line number Diff line number Diff line change
Expand Up @@ -318,72 +318,72 @@ parameters:
path: ../../tests/system/Models/InsertModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$_options has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$_options has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$country has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$country has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$created_at has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$created_at has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$deleted has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$deleted has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$email has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$email has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$id has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$id has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$name has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$name has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:239\:\:\$updated_at has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:241\:\:\$updated_at has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:272\:\:\$_options has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:274\:\:\$_options has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:272\:\:\$created_at has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:274\:\:\$created_at has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:272\:\:\$id has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:274\:\:\$id has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:272\:\:\$name has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:274\:\:\$name has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:272\:\:\$updated_at has no type specified\.$#'
message: '#^Property CodeIgniter\\Entity\\Entity@anonymous/tests/system/Models/SaveModelTest\.php\:274\:\:\$updated_at has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

-
message: '#^Property CodeIgniter\\Model@anonymous/tests/system/Models/SaveModelTest\.php\:288\:\:\$name has no type specified\.$#'
message: '#^Property CodeIgniter\\Model@anonymous/tests/system/Models/SaveModelTest\.php\:290\:\:\$name has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

Expand Down
Loading