From 107a26b966976be8e858974f12d8ae343dac6e8e Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 11 Jan 2024 13:03:56 +1300 Subject: [PATCH] ENH Add generic types --- src/Model/Blog.php | 4 ++-- src/Model/BlogCommentExtension.php | 3 +++ src/Model/BlogController.php | 12 ++++++------ src/Model/BlogFilter.php | 1 - src/Model/BlogMemberExtension.php | 2 ++ src/Model/BlogPostController.php | 3 +++ src/Model/BlogPostFeaturedExtension.php | 2 ++ src/Model/BlogPostFilter.php | 1 + src/Model/BlogPostNotifications.php | 2 ++ 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/Model/Blog.php b/src/Model/Blog.php index a193731c0..d3aeec918 100644 --- a/src/Model/Blog.php +++ b/src/Model/Blog.php @@ -533,7 +533,7 @@ public function canEditContributors($member = null) * @param null|int $month * @param null|int $day * - * @return DataList + * @return DataList */ public function getArchivedBlogPosts($year, $month = null, $day = null) { @@ -574,7 +574,7 @@ public function getArchivedBlogPosts($year, $month = null, $day = null) /** * Return blog posts. * - * @return DataList of BlogPost objects + * @return DataList of BlogPost objects */ public function getBlogPosts() { diff --git a/src/Model/BlogCommentExtension.php b/src/Model/BlogCommentExtension.php index e8c9d204d..ef72640c4 100644 --- a/src/Model/BlogCommentExtension.php +++ b/src/Model/BlogCommentExtension.php @@ -2,10 +2,13 @@ namespace SilverStripe\Blog\Model; +use SilverStripe\Comments\Model\Comment; use SilverStripe\ORM\DataExtension; /** * Adds Blog specific behaviour to Comment. + * + * @extends DataExtension */ class BlogCommentExtension extends DataExtension { diff --git a/src/Model/BlogController.php b/src/Model/BlogController.php index 99a9fecf1..2b1568e07 100644 --- a/src/Model/BlogController.php +++ b/src/Model/BlogController.php @@ -16,6 +16,9 @@ use SilverStripe\View\Parsers\URLSegmentFilter; use SilverStripe\Control\HTTPRequest; +/** + * @extends PageController + */ class BlogController extends PageController { /** @@ -58,7 +61,7 @@ class BlogController extends PageController /** * The current Blog Post DataList query. * - * @var DataList + * @var DataList */ protected $blogPosts; @@ -67,9 +70,6 @@ class BlogController extends PageController */ public function index(HTTPRequest $request) { - /** - * @var Blog $dataRecord - */ $dataRecord = $this->dataRecord; $this->blogPosts = $dataRecord->getBlogPosts(); @@ -128,7 +128,7 @@ public function getCurrentProfile() /** * Get posts related to the current Member profile. * - * @return null|DataList + * @return null|DataList */ public function getCurrentProfilePosts() { @@ -443,7 +443,7 @@ public function getFilterDescription() /** * Returns a list of paginated blog posts based on the BlogPost dataList. * - * @return PaginatedList + * @return PaginatedList */ public function PaginatedList() { diff --git a/src/Model/BlogFilter.php b/src/Model/BlogFilter.php index 89d348eb1..62e580148 100644 --- a/src/Model/BlogFilter.php +++ b/src/Model/BlogFilter.php @@ -16,7 +16,6 @@ /** * This class is responsible for filtering the SiteTree when necessary and also overlaps into * filtering only published posts. - * */ class BlogFilter extends Lumberjack { diff --git a/src/Model/BlogMemberExtension.php b/src/Model/BlogMemberExtension.php index ed453f6eb..c5c104a49 100644 --- a/src/Model/BlogMemberExtension.php +++ b/src/Model/BlogMemberExtension.php @@ -19,6 +19,8 @@ * * @method SilverStripe\ORM\ManyManyList BlogPosts() * @method Image BlogProfileImage() + * + * @extends DataExtension */ class BlogMemberExtension extends DataExtension { diff --git a/src/Model/BlogPostController.php b/src/Model/BlogPostController.php index 706ec4600..6a05e5a45 100644 --- a/src/Model/BlogPostController.php +++ b/src/Model/BlogPostController.php @@ -4,6 +4,9 @@ use PageController; +/** + * @extends PageController + */ class BlogPostController extends PageController { diff --git a/src/Model/BlogPostFeaturedExtension.php b/src/Model/BlogPostFeaturedExtension.php index 80128d88c..e98dd0dcd 100644 --- a/src/Model/BlogPostFeaturedExtension.php +++ b/src/Model/BlogPostFeaturedExtension.php @@ -8,6 +8,8 @@ /** * Adds a checkbox field for featured blog posts widget. + * + * @extends DataExtension */ class BlogPostFeaturedExtension extends DataExtension { diff --git a/src/Model/BlogPostFilter.php b/src/Model/BlogPostFilter.php index e296864df..f589654bd 100644 --- a/src/Model/BlogPostFilter.php +++ b/src/Model/BlogPostFilter.php @@ -17,6 +17,7 @@ * This is responsible for filtering only published posts to users who do not have permission to * view non-published posts. * + * @extends DataExtension */ class BlogPostFilter extends DataExtension { diff --git a/src/Model/BlogPostNotifications.php b/src/Model/BlogPostNotifications.php index eca2f7c98..26a17d608 100644 --- a/src/Model/BlogPostNotifications.php +++ b/src/Model/BlogPostNotifications.php @@ -12,6 +12,8 @@ * Customise blog post to support comment notifications. * * Extends {@see BlogPost} with extensions to {@see CommentNotifiable}. + * + * @extends DataExtension */ class BlogPostNotifications extends DataExtension {