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
Any logical reason for some interfaces have __construct methods ? We cant create objects from interfaces, it's just a contract.
I think we should split constructors from interfaces and create maybe abstract classes with __onconstruct definition which implement those interfaces.
For example - thats why i needed to create so simple interfaces RoleAware and ResourceAware beacause RoleInterface and ResourceInterface have __construct methods, and then you cant have for example class extending Model and RoleInterface.
I know its php, but i think there shouldn't be constructors in interfaces, well i think even magic methods should go away.
Well i know its not thing for change for any minor version. But it's thing to consider in next major version(3.x).
The text was updated successfully, but these errors were encountered:
Any logical reason for some interfaces have
__construct
methods ? We cant create objects from interfaces, it's just a contract.I think we should split constructors from interfaces and create maybe abstract classes with __onconstruct definition which implement those interfaces.
For example - thats why i needed to create so simple interfaces
RoleAware
andResourceAware
beacauseRoleInterface
andResourceInterface
have__construct
methods, and then you cant have for example class extendingModel
andRoleInterface
.I know its php, but i think there shouldn't be constructors in interfaces, well i think even magic methods should go away.
Well i know its not thing for change for any minor version. But it's thing to consider in next major version(3.x).
The text was updated successfully, but these errors were encountered: