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

Add TermTypes interface with term type constants #821

Merged
merged 1 commit into from
Jan 30, 2020
Merged

Conversation

jakobw
Copy link
Member

@jakobw jakobw commented Jan 30, 2020

Useful when passing term types to services like TermBuffer.


public const TYPE_LABEL = 'label';
public const TYPE_DESCRIPTION = 'description';
public const TYPE_ALIAS = 'alias';
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe having one for aliases would be good too? Just thinking out loud.

Copy link
Member Author

Choose a reason for hiding this comment

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

The scary thing is that some services (e.g. TermBuffer and by association PrefetchingTermLookup and friends) expect to be passed 'alias' not 'aliases' to fetch all aliases. That can probably be solved by documenting it properly, but my original motivation was actually to have these constants to avoid exactly this mix-up.

@JeroenDeDauw
Copy link
Contributor

Maybe final class is better than interface

Useful when passing term types to services like TermBuffer.
@jakobw
Copy link
Member Author

jakobw commented Jan 30, 2020

Maybe final class is better than interface

Done!

@Ladsgroup Ladsgroup merged commit fc7e0cf into master Jan 30, 2020
@Ladsgroup Ladsgroup deleted the term-types branch January 30, 2020 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants