Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW Add FilterInterface and retrofit into URLSegmentFilter #9064

Merged

Conversation

robbieaverill
Copy link
Contributor

@robbieaverill robbieaverill commented Jun 14, 2019

There are other filters in the core SilverStripe product, e.g. FileNameFilter in silverstripe/assets which would benefit from having a common filter interface. This retrofits one for URLSegmentFilter in framework. I have not added any PHP 7 syntax in method signatures to avoid breaking backwards compatibility.

Note: it's possible this could be seen as a breaking change, if someone had replaced URLSegmentFilter with their own implementation that didn't extend it. At this point there are no consumers of the FilterInterface directly, so this wouldn't break anything immediately, but there is a possibility it could break something in a future release if FilterInterface is type hinted somewhere. For this reason I'd be OK with retargetting at SilverStripe 5.x if somebody is concerned about this. If people have typehints on this class it would be on URLSegmentFilter, in which case retrofitting this interface won't break those.

@robbieaverill robbieaverill force-pushed the pulls/4.5/filter-interface branch 2 times, most recently from 750640f to 8db8e4e Compare July 26, 2019 07:38
@robbieaverill
Copy link
Contributor Author

I can't rebase this any more, @NightJar @Cheddam would one of you mind doing it for me please?

@NightJar
Copy link
Contributor

NightJar commented Oct 3, 2019

on to master?

@robbieaverill
Copy link
Contributor Author

The current branch please :-)

There are other filters in the core SilverStripe product, e.g. FileNameFilter in silverstripe/assets
which would benefit from having a common filter interface. This retrofits one for URLSegmentFilter
in framework. I have not added any PHP 7 syntax in method signatures to avoid breaking backwards
compatibility.
Copy link
Member

@Cheddam Cheddam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems safe to ship in 4.x, let's get it in for 4.7.

@Cheddam Cheddam merged commit e244376 into silverstripe:4 Jul 26, 2020
@Cheddam Cheddam deleted the pulls/4.5/filter-interface branch July 26, 2020 23:18
@Cheddam Cheddam added this to the Sprint 64 milestone Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants