There is a coding pattern that I see (and have used) in PHP code that defines generic methods on a class for setting and getting properties.
function set($name, $value);
function get($name);
Google code search for examples
Some times there are some ancillary methods to deal with unsetting, checking for existence, setting via an array, or dealing with references in [...]
Let Your Properties be Properties
May 8th, 2007Bad Code Smells in WACT, a refactoring review
October 18th, 2004This post shows some bad design elements in WACT and discusses how to improve them. It lists some related bad code smells in the WACT template compiler. It is a non-trivial example of refactoring in an established application and an illustration of OO design issues.
related files:
treebuilder.inc.php
parserstate.inc.php
tagjudge.inc.php
tagdictionary.inc.php
input.tag.php
The TreeBuilder and ComponentParsingState classes may need to [...]
PHP Coding Standards
September 24th, 2004I have to disagree with Paul Jones on coding standards:
The thing about defining a coding style standard is that there is no objective means by which to judge one style as “better†or “more-right†than another.
I can think of several objective criteria for judging coding standards practices off the top of my head:
Does the practice [...]