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
In src/DB.php it is using static classes. This is not really wrong since they are returning classes instances so they are still injectable.
What should be changed is that they become true factories by removing the parameters from the static function unless it has something to do with the factory.
A different solution would be removing the statics so that you can just inject the DB class directly into a class. That way it will act a some kind of facade.
Since PHP 5.4 statics are not really useful anymore for their "nice" syntax. You can now do something like this: $select = (new Database)->select($params);
The text was updated successfully, but these errors were encountered:
In
src/DB.php
it is using static classes. This is not really wrong since they are returning classes instances so they are still injectable.What should be changed is that they become true factories by removing the parameters from the static function unless it has something to do with the factory.
A different solution would be removing the statics so that you can just inject the DB class directly into a class. That way it will act a some kind of facade.
Since PHP 5.4 statics are not really useful anymore for their "nice" syntax. You can now do something like this:
$select = (new Database)->select($params);
The text was updated successfully, but these errors were encountered: