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 #739

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

GuySartorelli
Copy link
Member

Requires silverstripe/silverstripe-framework#11108 and the associated PRs in silverstripe/cms and silverstripe/lumberjack for these generics to take effect.

Issue

@@ -443,7 +443,7 @@ public function getFilterDescription()
/**
* Returns a list of paginated blog posts based on the BlogPost dataList.
*
* @return PaginatedList
* @return PaginatedList<ArrayList, BlogPost>
Copy link
Member

Choose a reason for hiding this comment

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

Could you just double check this is correct - $allPosts = $this->blogPosts ?: ArrayList::create(); - $this->blogPosts has a docblock var of DataList and when it's assigned by methods like getCurrentProfilePosts() it's a DataList

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, I must have missed that, good call. I'll just use SS_List instead - this method will probably mostly be called in a template anyway so doesn't matter too much.

@emteknetnz emteknetnz merged commit 3b80922 into silverstripe:4 Jan 18, 2024
12 checks passed
@emteknetnz emteknetnz deleted the pulls/4/add-generics branch January 18, 2024 20:58
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