ENH Add generic types (#220)

This commit is contained in:
Guy Sartorelli 2024-01-19 10:01:38 +13:00 committed by GitHub
parent 21ed224d5a
commit f04e9fa4ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 23 additions and 7 deletions

View File

@ -4,6 +4,7 @@ namespace SilverStripe\ContentReview\Extensions;
use SilverStripe\Admin\LeftAndMain; use SilverStripe\Admin\LeftAndMain;
use SilverStripe\Admin\LeftAndMainExtension; use SilverStripe\Admin\LeftAndMainExtension;
use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\ContentReview\Forms\ReviewContentHandler; use SilverStripe\ContentReview\Forms\ReviewContentHandler;
use SilverStripe\ContentReview\Traits\PermissionChecker; use SilverStripe\ContentReview\Traits\PermissionChecker;
@ -17,6 +18,8 @@ use SilverStripe\Security\Security;
/** /**
* CMSPageEditController extension to receive the additional action button from * CMSPageEditController extension to receive the additional action button from
* SiteTreeContentReview::updateCMSActions() * SiteTreeContentReview::updateCMSActions()
*
* @extends LeftAndMainExtension<CMSMain>
*/ */
class ContentReviewCMSExtension extends LeftAndMainExtension class ContentReviewCMSExtension extends LeftAndMainExtension
{ {

View File

@ -14,6 +14,7 @@ use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\Group; use SilverStripe\Security\Group;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use SilverStripe\Security\Permission; use SilverStripe\Security\Permission;
use SilverStripe\SiteConfig\SiteConfig;
/** /**
* This extensions add a default schema for new pages and pages without a content * This extensions add a default schema for new pages and pages without a content
@ -22,6 +23,8 @@ use SilverStripe\Security\Permission;
* @property int $ReviewPeriodDays * @property int $ReviewPeriodDays
* @method SilverStripe\ORM\ManyManyList<Group> ContentReviewGroups() * @method SilverStripe\ORM\ManyManyList<Group> ContentReviewGroups()
* @method SilverStripe\ORM\ManyManyList<Member> ContentReviewUsers() * @method SilverStripe\ORM\ManyManyList<Member> ContentReviewUsers()
*
* @extends DataExtension<SiteConfig>
*/ */
class ContentReviewDefaultSettings extends DataExtension class ContentReviewDefaultSettings extends DataExtension
{ {
@ -88,7 +91,7 @@ class ContentReviewDefaultSettings extends DataExtension
} }
/** /**
* @return ManyManyList * @return ManyManyList<Group>
*/ */
public function OwnerGroups() public function OwnerGroups()
{ {
@ -96,7 +99,7 @@ class ContentReviewDefaultSettings extends DataExtension
} }
/** /**
* @return ManyManyList * @return ManyManyList<Member>
*/ */
public function OwnerUsers() public function OwnerUsers()
{ {
@ -180,7 +183,7 @@ class ContentReviewDefaultSettings extends DataExtension
* Get all Members that are default Content Owners. This includes checking group hierarchy * Get all Members that are default Content Owners. This includes checking group hierarchy
* and adding any direct users. * and adding any direct users.
* *
* @return ArrayList * @return ArrayList<Group|Member>
*/ */
public function ContentReviewOwners() public function ContentReviewOwners()
{ {

View File

@ -2,8 +2,12 @@
namespace SilverStripe\ContentReview\Extensions; namespace SilverStripe\ContentReview\Extensions;
use SilverStripe\Admin\LeftAndMain;
use SilverStripe\Admin\LeftAndMainExtension; use SilverStripe\Admin\LeftAndMainExtension;
/**
* @extends LeftAndMainExtension<LeftAndMain>
*/
class ContentReviewLeftAndMainExtension extends LeftAndMainExtension class ContentReviewLeftAndMainExtension extends LeftAndMainExtension
{ {
/** /**

View File

@ -5,9 +5,13 @@ namespace SilverStripe\ContentReview\Extensions;
use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\FieldList; use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\Group;
use SilverStripe\Security\Member;
/** /**
* @method SilverStripe\ORM\ManyManyList<SiteTree> SiteTreeContentReview() * @method SilverStripe\ORM\ManyManyList<SiteTree> SiteTreeContentReview()
*
* @extends DataExtension<Group|Member>
*/ */
class ContentReviewOwner extends DataExtension class ContentReviewOwner extends DataExtension
{ {

View File

@ -53,6 +53,8 @@ use Symbiote\QueuedJobs\Services\QueuedJobService;
* @method SilverStripe\ORM\ManyManyList<Group> ContentReviewGroups() * @method SilverStripe\ORM\ManyManyList<Group> ContentReviewGroups()
* @method SilverStripe\ORM\ManyManyList<Member> ContentReviewUsers() * @method SilverStripe\ORM\ManyManyList<Member> ContentReviewUsers()
* @method SilverStripe\ORM\HasManyList<ContentReviewLog> ReviewLogs() * @method SilverStripe\ORM\HasManyList<ContentReviewLog> ReviewLogs()
*
* @extends DataExtension<SiteTree>
*/ */
class SiteTreeContentReview extends DataExtension implements PermissionProvider class SiteTreeContentReview extends DataExtension implements PermissionProvider
{ {
@ -119,7 +121,7 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
* @param SS_List $groups * @param SS_List $groups
* @param SS_List $members * @param SS_List $members
* *
* @return ArrayList * @return ArrayList<Group|Member>
*/ */
public static function merge_owners(SS_List $groups, SS_List $members) public static function merge_owners(SS_List $groups, SS_List $members)
{ {
@ -293,7 +295,7 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
* Get all Members that are Content Owners to this page. This includes checking group * Get all Members that are Content Owners to this page. This includes checking group
* hierarchy and adding any direct users. * hierarchy and adding any direct users.
* *
* @return ArrayList * @return ArrayList<Group|Member>
*/ */
public function ContentReviewOwners() public function ContentReviewOwners()
{ {
@ -304,7 +306,7 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
} }
/** /**
* @return ManyManyList * @return ManyManyList<Group>
*/ */
public function OwnerGroups() public function OwnerGroups()
{ {
@ -312,7 +314,7 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
} }
/** /**
* @return ManyManyList * @return ManyManyList<Member>
*/ */
public function OwnerUsers() public function OwnerUsers()
{ {