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

MNT Update @methods on class docblocks #11092

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Dev/Validation/DatabaseAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/**
* Hook up static validation to the deb/build process
*
* @method DatabaseAdmin getOwner()
GuySartorelli marked this conversation as resolved.
Show resolved Hide resolved
*/
class DatabaseAdminExtension extends Extension
{
Expand Down
1 change: 0 additions & 1 deletion src/ORM/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
* If any public method on this class is prefixed with an underscore,
* the results are cached in memory through {@link cachedCall()}.
*
*
* @property int $ID ID of the DataObject, 0 if the DataObject doesn't exist in database.
* @property int $OldID ID of object, if deleted
* @property string $Title
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Hierarchy/Hierarchy.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*
* @property int $ParentID
* @property DataObject|Hierarchy $owner
* @method DataObject Parent()
Copy link
Member

Choose a reason for hiding this comment

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

This one needs to stay - see the (non-standard) get_extra_config() method which is adding the has_one relation.

*/
class Hierarchy extends DataExtension
{
Expand Down
9 changes: 5 additions & 4 deletions src/Security/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
*
* @property int $ParentID ID of parent group
*
* @method Group Parent() Return parent group
* @method HasManyList Permissions() List of group permissions
* @method HasManyList Groups() List of child groups
* @method ManyManyList Roles() List of PermissionRoles
* @mixin Hierarchy
* @method SilverStripe\ORM\HasManyList<Group> Groups()
* @method SilverStripe\ORM\ManyManyList<Member> Members()
* @method Group Parent()
* @method SilverStripe\ORM\HasManyList<Permission> Permissions()
* @method SilverStripe\ORM\ManyManyList<PermissionRole> Roles()
Comment on lines -50 to +55
Copy link
Member

@GuySartorelli GuySartorelli Dec 13, 2023

Choose a reason for hiding this comment

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

HasManyList and ManyManyList are imported as use statements above (presumably specifically for the @method annotations)

If those use statements aren't used elsewhere, they should be removed.
Otherwise, we should probably just use the short form here in the @method annotations.

Since having extra use statements doesn't really cause any problems, it's just a little untidy - and same with unnecessary FQCN, I'll also accept it if you decide it's not worth changing the way your code writer handles this - in which case you can just mark this and the related items as resolved.

*/
class Group extends DataObject
{
Expand Down
8 changes: 4 additions & 4 deletions src/Security/InheritedPermissionsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
*
* @property string $CanViewType
* @property string $CanEditType
* @method ManyManyList ViewerGroups()
* @method ManyManyList EditorGroups()
* @method ManyManyList ViewerMembers()
* @method ManyManyList EditorMembers()
* @method SilverStripe\ORM\ManyManyList<Group> EditorGroups()
* @method SilverStripe\ORM\ManyManyList<Member> EditorMembers()
* @method SilverStripe\ORM\ManyManyList<Group> ViewerGroups()
* @method SilverStripe\ORM\ManyManyList<Member> ViewerMembers()
Comment on lines -13 to +16
Copy link
Member

@GuySartorelli GuySartorelli Dec 13, 2023

Choose a reason for hiding this comment

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

See above comment and perform the same actions here as you will there.

*/
class InheritedPermissionsExtension extends DataExtension
{
Expand Down
2 changes: 1 addition & 1 deletion src/Security/LoginAttempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @property string $IP IP address of user attempting to login
* @property int $MemberID ID of the Member
*
* @method Member Member() Member object of the user trying to log in
* @method Member Member()
*/
class LoginAttempt extends DataObject
{
Expand Down
5 changes: 3 additions & 2 deletions src/Security/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
/**
* The member class which represents the users of the system
*
* @method HasManyList LoggedPasswords()
* @method HasManyList RememberLoginHashes()
* @property string $FirstName
* @property string $Surname
* @property string $Email
Expand All @@ -57,6 +55,9 @@
* @property int $FailedLoginCount
* @property string $DateFormat
* @property string $TimeFormat
* @method SilverStripe\ORM\ManyManyList<Group> Groups()
* @method SilverStripe\ORM\HasManyList<MemberPassword> LoggedPasswords()
* @method SilverStripe\ORM\HasManyList<RememberLoginHash> RememberLoginHashes()
Comment on lines +58 to +60
Copy link
Member

@GuySartorelli GuySartorelli Dec 13, 2023

Choose a reason for hiding this comment

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

See above comment and perform the same actions here as you will there.

*/
class Member extends DataObject
{
Expand Down
2 changes: 1 addition & 1 deletion src/Security/MemberPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @property string $Salt
* @property string $PasswordEncryption
* @property int $MemberID ID of the Member
* @method Member Member() Owner of the password
* @method Member Member()
*/
class MemberPassword extends DataObject
{
Expand Down
4 changes: 2 additions & 2 deletions src/Security/PermissionRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* @property string Title
* @property string OnlyAdminCanApply
*
* @method HasManyList Codes() List of PermissionRoleCode objects
* @method ManyManyList Groups() List of Group objects
* @method SilverStripe\ORM\HasManyList<PermissionRoleCode> Codes()
* @method SilverStripe\ORM\ManyManyList<Group> Groups()
Comment on lines -23 to +24
Copy link
Member

@GuySartorelli GuySartorelli Dec 13, 2023

Choose a reason for hiding this comment

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

See above comment and perform the same actions here as you will there.

*/
class PermissionRole extends DataObject
{
Expand Down