diff --git a/composer.json b/composer.json index 803ae6eb46b3..c014955de044 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require-dev": { "boundwize/structarmed": "^0.21", - "codeigniter/phpstan-codeigniter": "^2.3", + "codeigniter/phpstan-codeigniter": "^2.4", "fakerphp/faker": "^1.24", "kint-php/kint": "^6.1", "mikey179/vfsstream": "^1.6.12", diff --git a/docs/models/entities.md b/docs/models/entities.md index a05f9a2a6d41..e11da9c239ed 100644 --- a/docs/models/entities.md +++ b/docs/models/entities.md @@ -601,6 +601,7 @@ Now you need to register it: namespace App\Entities; +use App\Entities\Cast\CastBase64; use CodeIgniter\Entity\Entity; class MyEntity extends Entity @@ -612,7 +613,7 @@ class MyEntity extends Entity // Bind the type to the handler protected $castHandlers = [ - 'base64' => Cast\CastBase64::class, + 'base64' => CastBase64::class, ]; } @@ -649,6 +650,7 @@ In some cases, one type is not enough. In this situation, you can use additional namespace App\Entities; +use App\Entities\Cast\SomeHandler; use CodeIgniter\Entity\Entity; class MyEntity extends Entity @@ -660,7 +662,7 @@ class MyEntity extends Entity // Bind the type to the handler protected $castHandlers = [ - 'class' => 'SomeHandler', + 'class' => SomeHandler::class, ]; } ``` diff --git a/tests/system/Entity/EntityTest.php b/tests/system/Entity/EntityTest.php index 3aff3fac3a10..c8efef146c61 100644 --- a/tests/system/Entity/EntityTest.php +++ b/tests/system/Entity/EntityTest.php @@ -1856,7 +1856,7 @@ private function getCustomCastEntity(): object ]; protected $castHandlers = [ 'base64' => CastBase64::class, - 'someType' => NotExtendsBaseCast::class, + 'someType' => NotExtendsBaseCast::class, // @phpstan-ignore codeigniter.castHandlerInvalid 'type' => CastPassParameters::class, ]; };