Skip to content

Update FolderInterface.php: Adding return type for better static analysis - #199

Open
ThomasLandauer wants to merge 1 commit into
DirectoryTree:masterfrom
ThomasLandauer:patch-1
Open

ThomasLandauer wants to merge 1 commit into
DirectoryTree:masterfrom
ThomasLandauer:patch-1

Conversation

@ThomasLandauer

Copy link
Copy Markdown

I'm suggesting to add types for the array elements like this; for other arrays too. I haven't double-checked if those here are really correct for all cases.

…ysis

I'm suggesting to add types for the array elements like this; for other arrays too.
I haven't double-checked if those here are really correct for all cases.
Comment thread src/FolderInterface.php
@@ -68,6 +68,7 @@ public function quota(): array;

/**
* Get the folder's status.
* @return array{'MESSAGES': string, 'RECENT': string, 'UIDNEXT': string, 'UIDVALIDITY': string, 'UNSEEN': string}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we sure this is the case across all IMAP providers?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No. But since you're mentioning them at https://github.com/DirectoryTree/ImapEngine/blob/master/src/Connection/ConnectionInterface.php#L244 I was figuring that this would be some standard.
If not, what about @return array<string, string>? Or would it be possible that you convert the values to int, to get @return array<string, int>?

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