Closed Maks3w closed 9 years ago
IMO InputFilter::add() method should be deprecated and encourage the use of external call to Factory for achieve the same functionallity.
The one problem I see with this is that removing it from the interface would mean that InputFilter
's implementation automatically violates the interface. While I totally understand your view point that we may want to recommend using an external factory instead of add()
+array specification, that doesn't address the current and existing behavior.
A better solution would be to specify in the interface that the implementation MUST handle one or more of the argument types specified, and CAN raise an exception for any it cannot process. This would make it valid for all implementations shipped.
Updated with suggestions on merge.
array capabilities only exists for InputFilter class but not for their parent BaseInputFilter which is responsible of implement the interface.
People with tools warning about unsafe type should typehint against Zend\InputFilter\InputFilter instead Zend\InputFilter\InputFilterInterface
Reverts: