Skip to content

Commit 6730a79

Browse files
committed
fix: Apply suggestions
1 parent d2a845c commit 6730a79

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

system/Entity/Entity.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ protected function castAs($value, string $attribute, string $method = 'get')
574574
}
575575

576576
/**
577-
* This method allows you to refuse to contain an unnecessary DataCaster if you do not use casting.
577+
* Returns a DataCaster instance when casts are defined.
578+
* If no casts are configured, no DataCaster is created and null is returned.
578579
*/
579580
protected function dataCaster(): ?DataCaster
580581
{
@@ -620,9 +621,6 @@ public function cast(?bool $cast = null)
620621

621622
$this->_cast = $cast;
622623

623-
// Synchronize option with DataCaster initialization
624-
$this->dataCaster();
625-
626624
return $this;
627625
}
628626

0 commit comments

Comments
 (0)