Spoon/Form — Issue #5: Form name should be in the __constructor
Author: bauffman
Created: 2012-02-09 16:07:22+00:00
State: open

$form = new Form(new Environment());

echo $form;

=> Fatal error: Method Spoon\Form\Form::__toString() must not throw an exception

This is because $form->getName() internally will throw an exception that this field is not yet set. It would be better to make this field 'name' obligated in the constructor.

$form = new Form('my_name', new Environment());