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

ENH Add generic types #67

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Jan 11, 2024

Requires silverstripe/silverstripe-framework#11108 and the corresponding silverstripe/cms PR for these generics to take effect.

Issue

Comment on lines 22 to 23
* @template T of SiteTree
* @extends ContentController<T>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @template T of SiteTree
* @extends ContentController<T>
* @extends ContentController<SiteTree>

You'll also need to import SiteTree

I haven't consistently checked that things like SiteTree, DataObject etc have been imported for use in docblocks, you should probably spin off a new card to validate docblock imports

Copy link
Member Author

Choose a reason for hiding this comment

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

I had this extensible so people can subclass it with their own type - but that's probably unlikely enough that making the suggested change is fine.
Done

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't consistently checked that things like SiteTree, DataObject etc have been imported for use in docblocks, you should probably spin off a new card to validate docblock imports

I've added this as an AC for silverstripe/.github#181

@emteknetnz emteknetnz merged commit 894f204 into silverstripe:2 Jan 19, 2024
9 checks passed
@emteknetnz emteknetnz deleted the pulls/2/add-generics branch January 19, 2024 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants