zendframework / zend-form

Form component from Zend Framework
BSD 3-Clause "New" or "Revised" License
69 stars 87 forks source link

`Form/Fieldset` dependency on `FormInterface` #93

Open GeeH opened 8 years ago

GeeH commented 8 years ago

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7192 User: @claytondaley Created On: 2015-02-06T16:14:35Z Updated At: 2015-11-06T21:02:59Z Body I'm trying to build an extensible HTML table generator and want to provide HTML table builders a comparable experience -- infrastructure and syntax -- to form construction. Obviously, I don't need a bunch of the form infrastructure (input filters or validation) so I expected to extend Fieldset instead of Form.

As I worked my way through this possibility, I discovered that the type hint for Fieldset->prepareElement() is actually FormInterface per an inheritance from ElementPrepareAwareInterface. Obviously, any class that extends Fieldset will not meet this requirement. I'm trying to find out if this dependency is really obligatory or if you'd consider a BC-incompatible reduction to FieldsetInterface.

In favor of reducing this requirement to FieldsetInterface:

In favor of staying at FormInterface:


Comment

User: @claytondaley Created On: 2015-02-07T23:22:23Z Updated At: 2015-02-07T23:22:23Z Body Incidentally, get/setFormFactory has similar (possibly worse) issues.

Presumably, the right hint is FieldsetInterface. At minimum, a change to FormInterface would be consistent with a previously accepted change -- #3526.

In the long run (maybe ZF3), it'd be better to clean up names (FormFactoryAwareInterface) and split (but extend) the factories so they're easier to inherit.


Comment

User: @claytondaley Created On: 2015-03-24T18:08:00Z Updated At: 2015-03-24T18:08:06Z Body closed by #7344


Comment

User: @weierophinney Created On: 2015-03-28T20:34:00Z Updated At: 2015-03-28T20:34:00Z Body Re-opening; reverted #7344 due to the BC breaks it introduces.


michalbundyra commented 4 years ago

This repository has been closed and moved to laminas/laminas-form; a new issue has been opened at https://github.com/laminas/laminas-form/issues/35.