This post originated from an RSS feed registered with PHP Buzz
by Jason Sweat.
Original Post: PHP5 Setters Should Return $this
Feed Title: Jason E. Sweat's weblog
Feed URL: http://blog.casey-sweat.us/?feed=rss2
Feed Description: Blogging about whatever interests me at the moment, mainly PHP, web application and Gentoo Linux.
I think that as a convention, I will now have all setters return $this instead of null. I arrived at this decision from messing around with the Specification design pattern ("Domain Driven Design" by Eric Evans, pg. 224). Doing so allowes me to trim several lines, and ...