DEV Community

Discussion on: PHP - Elegant method call

Collapse
 
maxkruse profile image
Maximilian Kruse

this is exactly why people say "OOP is stupid and not used correctly". The object in this case has no business with any of its functions, its just a namespace-delivery-system.

A simple function send_email() would be enough, this adds about 5x the bloat and you dont even create objects, just call a single static function.

Collapse
 
suddenlyrust profile image
Ruslan

Thank you for your feedback Maximillian. You are absolutely right. For the use case of sending a mail this pattern does not have any benefit.

Further explanation of this approach if you are interested 😊dev.to/suddenlyrust/comment/e58i