You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
FieldsetInterface is the interface that actually extends ElementPrepareAwareInterface
FieldsetInterface is inherited by all forms so this would be transparent to most users
Unless I missed something, none of the prepareElement implementations in Zend/Form depend on methods in Form but not in the Fieldset.
Makes Fieldset usable in isolation. The only other "Form" dependency is the Form/Factory which is really a common factory -- and appears to be so out of convenience not obligation.
In favor of staying at FormInterface:
BC break
Custom code may require a method from the FormInterface in their PrepareElement calls.
Form and Fieldset share a common Factory so they'd still be "coupled". As mentioned above, this appears to be a matter of convenience not coupling.
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.
The factory needs to be available in Fieldset because it supports factory-backed extension to the fieldset.
The methods is defined in FromFactoryAwareInterface which is included in FieldsetInterface and used in Fieldset
However, the hint for @returns is Form.
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.
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.htmlOriginal 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 ofForm
.As I worked my way through this possibility, I discovered that the type hint for
Fieldset->prepareElement()
is actuallyFormInterface
per an inheritance fromElementPrepareAwareInterface
. Obviously, any class that extendsFieldset
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 toFieldsetInterface
.In favor of reducing this requirement to
FieldsetInterface
:FieldsetInterface
is the interface that actually extendsElementPrepareAwareInterface
FieldsetInterface
is inherited by all forms so this would be transparent to most usersprepareElement
implementations inZend/Form
depend on methods inForm
but not in theFieldset
.Fieldset
usable in isolation. The only other "Form" dependency is theForm/Factory
which is really a common factory -- and appears to be so out of convenience not obligation.In favor of staying at
FormInterface
:FormInterface
in theirPrepareElement
calls.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.Fieldset
because it supports factory-backed extension to the fieldset.FromFactoryAwareInterface
which is included inFieldsetInterface
and used inFieldset
@returns
isForm
.Presumably, the right hint is
FieldsetInterface
. At minimum, a change toFormInterface
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.
Originally posted by @GeeH at zendframework/zend-form#93
The text was updated successfully, but these errors were encountered: