Skip to content
Open
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
55 changes: 34 additions & 21 deletions tests/system/Models/UpdateModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use CodeIgniter\Entity\Entity;
use CodeIgniter\Exceptions\InvalidArgumentException;
use Config\Database;
use DateTimeInterface;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use stdClass;
Expand Down Expand Up @@ -208,13 +209,17 @@ public function testUpdateBatchValidationFail(): void
public function testUpdateBatchWithEntity(): void
{
$entity1 = new class () extends Entity {
protected $id;
protected $name;
protected $email;
protected $country;
protected $deleted;
protected $created_at;
protected $updated_at;
protected int $id;
protected string $name;
protected string $email;
protected string $country;
protected bool $deleted;
protected DateTimeInterface $created_at;
protected DateTimeInterface $updated_at;

/**
* @var array{'datamap': array{}, 'dates': array{string, string, string}, 'casts': array{}}
*/
protected $_options = [
'datamap' => [],
'dates' => [
Expand All @@ -227,13 +232,17 @@ public function testUpdateBatchWithEntity(): void
};

$entity2 = new class () extends Entity {
protected $id;
protected $name;
protected $email;
protected $country;
protected $deleted;
protected $created_at;
protected $updated_at;
protected int $id;
protected string $name;
protected string $email;
protected string $country;
protected bool $deleted;
protected DateTimeInterface $created_at;
protected DateTimeInterface $updated_at;

/**
* @var array{'datamap': array{}, 'dates': array{string, string, string}, 'casts': array{}}
*/
protected $_options = [
'datamap' => [],
'dates' => [
Expand Down Expand Up @@ -399,13 +408,17 @@ public function testUpdateWithEntityNoAllowedFields(): void
$this->createModel(UserModel::class);

$entity = new class () extends Entity {
protected $id;
protected $name;
protected $email;
protected $country;
protected $deleted;
protected $created_at;
protected $updated_at;
protected int $id;
protected string $name;
protected string $email;
protected string $country;
protected bool $deleted;
protected DateTimeInterface $created_at;
protected DateTimeInterface $updated_at;

/**
* @var array{'datamap': array{}, 'dates': array{string, string, string}, 'casts': array{}}
*/
protected $_options = [
'datamap' => [],
'dates' => [
Expand Down
2 changes: 1 addition & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 2116 errors
# total 2092 errors

includes:
- argument.type.neon
Expand Down
122 changes: 1 addition & 121 deletions utils/phpstan-baseline/missingType.property.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 101 errors
# total 77 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -386,123 +386,3 @@ parameters:
message: '#^Property CodeIgniter\\Model@anonymous/tests/system/Models/SaveModelTest\.php\:290\:\:\$name has no type specified\.$#'
count: 1
path: ../../tests/system/Models/SaveModelTest.php

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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