3 ms·
In a language like PHP where you can't easily always easily refactor direct setting of properties (as opposed to Ruby), it makes sense to make anything where th
by mratzloff 14y ago
In a language like PHP where you can't easily always easily refactor direct setting of properties (as opposed to Ruby), it makes sense to make anything where the logic might change in the future into a setter. For simple struct-like objects with no calculation, direct setting is fine.
(I know this isn't strictly true about PHP with `__set()` and `__get()`, but that is hardly ideal.)