silverstripe/sapphire — pull request #151 by chillu (2012-01-02 16:50:53+00:00)
Title: Formfield constructor cleanup

The various FormField subclasses in core have been adding constructor arguments over time, which makes the fields harder to use due to the inconsinstency of parameter ordering. It leads to instanciations with a barrage of "null" values.

For example, on TextareaField $value is the 5th argument rather than the 3rd. Constructor arguments should be essential properties to the field (it can't exist without them), and stuff like $row and $col count doesn't fit this description. as there's accessors for the same purpose. The same reasoning applies for removing the $form argument, which is not essential to the field's existence, and rarely used.

In case you need those arguments, it means that you'll need to assign the form field to an instance variable and use accessors (no fluent interface), although I think thats acceptable.

I used the Deprecation API where feasible, but also ignore the additional arguments.