Welcome Guest, Not a member yet? Register   Sign In
Setter / Getter Best Practice 2016
#4

(07-26-2016, 08:36 AM)versalle88 Wrote: If this works well for you, I'd say it's okay. As far as best practices go, I think getters and setters should be separate methods; otherwise, you're violating the SRP:

https://en.wikipedia.org/wiki/Single_res..._principle

That sounds pretty good so more like 

$object->extension($ext);

and

$extension = $object->get_extension();

and no chaining??

DMyers
Reply


Messages In This Thread
Setter / Getter Best Practice 2016 - by dmyers - 07-25-2016, 04:08 PM
RE: Setter / Getter Best Practice 2016 - by dmyers - 07-27-2016, 11:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB