You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Entity class has the responsibility of Cast.
But, I would like to separate the responsibilities of Cast from Entity.
That is because Cast is highly likely to be used in various places and Entity and responsibility range are different.
The improvement approach is done in the following procedure.
Create a Caster class.
Implement casting of Entity class in Caster class.
Not sure this is needed. The response can already be served as either JSON or XML. This as a cast was only put in as a convenience to format it when it comes out of the database. And I allowed the PR on that because I've read json encoding is safer than PHP's serialize when it comes to storing stuff in the database.
Almost all of the conversions are simple things that PHP provides the ability do already.
The current Entity class has the responsibility of Cast.
But, I would like to separate the responsibilities of Cast from Entity.
That is because Cast is highly likely to be used in various places and Entity and responsibility range are different.
The improvement approach is done in the following procedure.
Does CodeIgniter want such a PR?
https://github.com/bcit-ci/CodeIgniter4/blob/b840d0a6d307df4da956561b599e443e467195d6/system/Entity.php
The text was updated successfully, but these errors were encountered: