Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Deprecate BaseInputFilter and fix for BaseInputFilter::add() contract violation #18

Conversation

Maks3w
Copy link
Member

@Maks3w Maks3w commented Aug 16, 2015

InputFlterInterface::add() specify array (input specification format) as an allowed type for $input. BaseInputFilter::add() throws exception for this case.

This commit promote the logic present in InputFilter to BaseInputFilter so BaseInputFilter becomes compatible with Interface contract.

Due InputFilter allow Traversable object, and Factory (underlying logic) allows InputProviderInterface objects then I decided promote all this types to the Interface too.

With this change BaseInputFilter is equal to InputFilter so BaseInputFilter has been declared as deprecated while InputFilter is preserved because his name is more relevant.

All of this is for to preserve the backward compatibility.

@Maks3w
Copy link
Member Author

Maks3w commented Aug 16, 2015

For v3 array, Traversable and InputProviderInterface should be removed from the interface contract and promove use Factory previously.

@Maks3w Maks3w force-pushed the hotfix/BaseInputFilter-does-bot-follow-add-contract branch from c793ff6 to 3b0d954 Compare August 16, 2015 08:09
@Maks3w Maks3w changed the title BaseInputFilter::add() does not allow all input types defined in the interface contract Deprecate InputFilter and fix BaseInputFilter::add() contract violation Aug 16, 2015
@Maks3w Maks3w force-pushed the hotfix/BaseInputFilter-does-bot-follow-add-contract branch 6 times, most recently from 42f5690 to 88bdf4a Compare August 16, 2015 09:18
@Maks3w Maks3w changed the title Deprecate InputFilter and fix BaseInputFilter::add() contract violation Deprecate BaseInputFilter and fix for BaseInputFilter::add() contract violation Aug 16, 2015
@Martin-P
Copy link
Contributor

Please mark as a BC break, because you are changing and moving class methods and therefore possibly breaking custom code which extends BaseInputFilter. Same as the other PR: this is not a bug, merely a possible enhancement.

@Maks3w
Copy link
Member Author

Maks3w commented Aug 16, 2015

@Martin-P Again. There is no BC Break. This PR fix BaseInputFilter::add does not allow input specifications (array) as the interface defines.

@Maks3w Maks3w force-pushed the hotfix/BaseInputFilter-does-bot-follow-add-contract branch 3 times, most recently from 395f478 to 564f4c0 Compare August 18, 2015 15:48
… violation

InputFlterInterface::add() specify array (input specification format) as an allowed type for $input. BaseInputFilter::add() throws exception for this case.

This commit promote the logic present in InputFilter to BaseInputFilter so BaseInputFilter becomes compatible with Interface contract.

Due InputFilter allow Traversable object, and Factory (underlying logic) allows InputProviderInterface objects then I decided promote all this types to the Interface too.

With this change BaseInputFilter is equal to InputFilter so BaseInputFilter has been declared as deprecated while InputFilter is preserved because his name is more relevant.

All of this is for to preserve the backward compatibility.
since 2.2.0 `@deprecated` annotations has the same effect of `@codeCoverageIgnore`

This is not good because there are critical classes in this project need to be sure are tested even if they are marked as deprecated.
@Maks3w Maks3w force-pushed the hotfix/BaseInputFilter-does-bot-follow-add-contract branch from 564f4c0 to 881abb3 Compare August 18, 2015 16:17
@weierophinney
Copy link
Member

I totally disagree with this.

The reason BaseInputFilter exists is so that if developers do not wish to use the factory capabilities, which have the overhead of plugin managers, they can. InputFilter extends BaseInputFilter in order to provide the factory capabilities specifically.

@Maks3w
Copy link
Member Author

Maks3w commented Aug 21, 2015

I've created #31 for remove array from interface contract (which could be see as a BC break)

@Maks3w Maks3w closed this Aug 21, 2015
@Maks3w Maks3w deleted the hotfix/BaseInputFilter-does-bot-follow-add-contract branch September 3, 2015 18:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants