radiate-framework / framework

A WordPress plugin and theme framework
https://radiate-framework.github.io/
MIT License
4 stars 0 forks source link

Implement Illuminate Contracts #123

Closed BenRutlandWeb closed 2 years ago

BenRutlandWeb commented 3 years ago

Is your feature request related to a problem? Please describe. The framework is heavily influenced by Laravel but doesn't use any Illuminate\Contracts

Describe the solution you'd like Where implementations allow, use the available contracts. This will make it easier to extend/use custom services. An example would be using the UserProvider interface for the WordPress/RadiateUserProvider classes.

Describe alternatives you've considered ¯_(ツ)_/¯

Additional context There are other components of the framework that could implement contracts to make them easily swappable.

BenRutlandWeb commented 3 years ago

Issues arise where WordPress related API's don't return what the contract relies on. I.e. WordPressUserProvider returns a WP_User instance which doesn't implement Authenticatable contract.

How to make the experience consistent without subclassing WP_User etc.

BenRutlandWeb commented 3 years ago

There are certainly other components that could implement contracts... these would need to be hunted down and checked properly to not break any existing implementation.