Skip to content

Commit

Permalink
CollectionInterface docs
Browse files Browse the repository at this point in the history
This needs some format fixing, maybe after the holiday weekend.
  • Loading branch information
valzargaming committed Jan 19, 2025
1 parent 442cb56 commit 27d2bb7
Show file tree
Hide file tree
Showing 20 changed files with 96 additions and 96 deletions.
8 changes: 4 additions & 4 deletions src/Discord/Parts/Channel/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
* @property int|null $bitrate The bitrate of the channel. Only for voice channels.
* @property int|null $user_limit The user limit of the channel. Max 99 for voice channels and 10000 for stage channels (0 refers to no limit).
* @property int|null $rate_limit_per_user Amount of seconds a user has to wait before sending a new message (slow mode).
* @property Collection|User[] $recipients A collection of all the recipients in the channel. Only for DM or group channels.
* @property CollectionInterface|User[] $recipients A collection of all the recipients in the channel. Only for DM or group channels.
* @property-read User|null $recipient The first recipient of the channel. Only for DM or group channels.
* @property-read string|null $recipient_id The ID of the recipient of the channel, if it is a DM channel.
* @property ?string|null $icon Icon hash.
Expand All @@ -85,7 +85,7 @@
* @property int|null $default_auto_archive_duration Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080.
* @property string|null $permissions Computed permissions for the invoking user in the channel, including overwrites, only included when part of the resolved data received on an application command interaction.
* @property int|null $flags Channel flags combined as a bitfield.
* @property Collection|Tag[] $available_tags Set of tags that can be used in a forum channel, limited to 20.
* @property CollectionInterface|Tag[] $available_tags Set of tags that can be used in a forum channel, limited to 20.
* @property ?Reaction|null $default_reaction_emoji Emoji to show in the add reaction button on a thread in a forum channel.
* @property int|null $default_thread_rate_limit_per_user The initial rate_limit_per_user to set on newly created threads in a forum channel. this field is copied to the thread at creation time and does not live update.
* @property ?int|null $default_sort_order The default sort order type used to order posts in forum channels.
Expand Down Expand Up @@ -252,7 +252,7 @@ protected function getRecipientIdAttribute(): ?string
/**
* Gets the recipients attribute.
*
* @return Collection A collection of recipients.
* @return CollectionInterface A collection of recipients.
*/
protected function getRecipientsAttribute(): CollectionInterface
{
Expand Down Expand Up @@ -996,7 +996,7 @@ protected function getPermissionOverwritesAttribute(): ?array
/**
* Gets the available tags attribute.
*
* @return Collection|Tag[] Available forum tags.
* @return CollectionInterface|Tag[] Available forum tags.
*
* @since 7.4.0
*/
Expand Down
28 changes: 14 additions & 14 deletions src/Discord/Parts/Channel/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
* @property Carbon|null $edited_timestamp A timestamp of when the message was edited, or null.
* @property bool $tts Whether the message was sent as a text-to-speech message.
* @property bool $mention_everyone Whether the message contained an @everyone mention.
* @property Collection|User[] $mentions A collection of the users mentioned in the message.
* @property Collection|Role[] $mention_roles A collection of roles that were mentioned in the message.
* @property Collection|Channel[] $mention_channels Collection of mentioned channels.
* @property Collection|Attachment[] $attachments Collection of attachment objects.
* @property Collection|Embed[] $embeds A collection of embed objects.
* @property CollectionInterface|User[] $mentions A collection of the users mentioned in the message.
* @property CollectionInterface|Role[] $mention_roles A collection of roles that were mentioned in the message.
* @property CollectionInterface|Channel[] $mention_channels Collection of mentioned channels.
* @property CollectionInterface|Attachment[] $attachments Collection of attachment objects.
* @property CollectionInterface|Embed[] $embeds A collection of embed objects.
* @property ReactionRepository $reactions Collection of reactions on the message.
* @property string|null $nonce A randomly generated string that provides verification for the client. Not required.
* @property bool $pinned Whether the message is pinned to the channel.
Expand All @@ -74,8 +74,8 @@
* @property Message|null $referenced_message The message that is referenced in a reply.
* @property MessageInteraction|null $interaction Sent if the message is a response to an Interaction.
* @property Thread|null $thread The thread that was started from this message, includes thread member object.
* @property Collection|Component[]|null $components Sent if the message contains components like buttons, action rows, or other interactive components.
* @property Collection|Sticker[]|null $sticker_items Stickers attached to the message.
* @property CollectionInterface|Component[]|null $components Sent if the message contains components like buttons, action rows, or other interactive components.
* @property CollectionInterface|Sticker[]|null $sticker_items Stickers attached to the message.
* @property int|null $position A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread, it can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread.
* @property object|null $role_subscription_data Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message.
* @property Poll|null $poll The poll attached to the message.
Expand Down Expand Up @@ -335,7 +335,7 @@ protected function getSuppressNotificationsAttribute(): bool
/**
* Gets the mention_channels attribute.
*
* @return Collection|Channel[]
* @return CollectionInterface|Channel[]
*/
protected function getMentionChannelsAttribute(): CollectionInterface
{
Expand All @@ -359,7 +359,7 @@ protected function getMentionChannelsAttribute(): CollectionInterface
/**
* Returns any attached files.
*
* @return Collection|Attachment[] Attachment objects.
* @return CollectionInterface|Attachment[] Attachment objects.
*/
protected function getAttachmentsAttribute(): CollectionInterface
{
Expand Down Expand Up @@ -491,7 +491,7 @@ protected function getGuildAttribute(): ?Guild
/**
* Returns the mention_roles attribute.
*
* @return Collection<?Role> The roles that were mentioned. null role only contains the ID in the collection.
* @return CollectionInterface<?Role> The roles that were mentioned. null role only contains the ID in the collection.
*/
protected function getMentionRolesAttribute(): CollectionInterface
{
Expand All @@ -515,7 +515,7 @@ protected function getMentionRolesAttribute(): CollectionInterface
/**
* Returns the mention attribute.
*
* @return Collection|User[] The users that were mentioned.
* @return CollectionInterface|User[] The users that were mentioned.
*/
protected function getMentionsAttribute(): CollectionInterface
{
Expand Down Expand Up @@ -582,7 +582,7 @@ protected function getMemberAttribute(): ?Member
/**
* Returns the embed attribute.
*
* @return Collection<Embed> A collection of embeds.
* @return CollectionInterface<Embed> A collection of embeds.
*/
protected function getEmbedsAttribute(): CollectionInterface
{
Expand Down Expand Up @@ -682,7 +682,7 @@ protected function getEditedTimestampAttribute(): ?Carbon
/**
* Returns the components attribute.
*
* @return Collection|Component[]|null
* @return CollectionInterface|Component[]|null
*/
protected function getComponentsAttribute(): ?Collection
{
Expand All @@ -702,7 +702,7 @@ protected function getComponentsAttribute(): ?Collection
/**
* Returns the sticker_items attribute.
*
* @return Collection|Sticker[]|null Partial stickers.
* @return CollectionInterface|Sticker[]|null Partial stickers.
*/
protected function getStickerItemsAttribute(): ?Collection
{
Expand Down
4 changes: 2 additions & 2 deletions src/Discord/Parts/Embed/Embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @property-read Video|null $video The video of the embed.
* @property-read object|null $provider The provider of the embed.
* @property Author|null $author The author of the embed.
* @property Collection|Field[] $fields A collection of embed fields.
* @property CollectionInterface|Field[] $fields A collection of embed fields.
*/
class Embed extends Part
{
Expand Down Expand Up @@ -136,7 +136,7 @@ protected function getAuthorAttribute(): Author
/**
* Gets the fields attribute.
*
* @return Collection|Field[]
* @return CollectionInterface|Field[]
*/
protected function getFieldsAttribute(): CollectionInterface
{
Expand Down
34 changes: 17 additions & 17 deletions src/Discord/Parts/Guild/AuditLog/AuditLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
*
* @since 5.1.0
*
* @property Collection|Command[] $application_commands List of application commands referenced in the audit log.
* @property Collection|Entry[] $audit_log_entries List of audit log entries.
* @property Collection|Rule[] $auto_moderation_rules List of auto moderation rules referenced in the audit log.
* @property Collection|ScheduledEvent[] $guild_scheduled_events List of guild scheduled events referenced in the audit log.
* @property Collection|Integration[] $integrations List of partial integration objects.
* @property Collection|Thread[] $threads List of threads referenced in the audit log.
* @property Collection|User[] $users List of users referenced in the audit log.
* @property Collection|Webhook[] $webhooks List of webhooks referenced in the audit log.
* @property CollectionInterface|Command[] $application_commands List of application commands referenced in the audit log.
* @property CollectionInterface|Entry[] $audit_log_entries List of audit log entries.
* @property CollectionInterface|Rule[] $auto_moderation_rules List of auto moderation rules referenced in the audit log.
* @property CollectionInterface|ScheduledEvent[] $guild_scheduled_events List of guild scheduled events referenced in the audit log.
* @property CollectionInterface|Integration[] $integrations List of partial integration objects.
* @property CollectionInterface|Thread[] $threads List of threads referenced in the audit log.
* @property CollectionInterface|User[] $users List of users referenced in the audit log.
* @property CollectionInterface|Webhook[] $webhooks List of webhooks referenced in the audit log.
*
* @property string $guild_id
* @property-read Guild|null $guild
Expand Down Expand Up @@ -75,7 +75,7 @@ protected function getGuildAttribute(): ?Guild
/**
* Returns a collection of application commands found in the audit log.
*
* @return Collection|Command[]
* @return CollectionInterface|Command[]
*/
protected function getApplicationCommandsAttribute(): CollectionInterface
{
Expand All @@ -91,7 +91,7 @@ protected function getApplicationCommandsAttribute(): CollectionInterface
/**
* Returns a collection of audit log entries.
*
* @return Collection|Entry[]
* @return CollectionInterface|Entry[]
*/
protected function getAuditLogEntriesAttribute(): CollectionInterface
{
Expand All @@ -107,7 +107,7 @@ protected function getAuditLogEntriesAttribute(): CollectionInterface
/**
* Returns a collection of auto moderation rules found in the audit log.
*
* @return Collection|Rule[]
* @return CollectionInterface|Rule[]
*/
protected function getAutoModerationRulesAttribute(): CollectionInterface
{
Expand All @@ -123,7 +123,7 @@ protected function getAutoModerationRulesAttribute(): CollectionInterface
/**
* Returns a collection of guild scheduled events found in the audit log.
*
* @return Collection|ScheduledEvent[]
* @return CollectionInterface|ScheduledEvent[]
*/
protected function getGuildScheduledEventsAttribute(): CollectionInterface
{
Expand All @@ -141,7 +141,7 @@ protected function getGuildScheduledEventsAttribute(): CollectionInterface
*
* @link https://discord.com/developers/docs/resources/audit-log#audit-log-object-example-partial-integration-object
*
* @return Collection|Integration[]
* @return CollectionInterface|Integration[]
*/
protected function getIntegrationsAttribute(): CollectionInterface
{
Expand All @@ -157,7 +157,7 @@ protected function getIntegrationsAttribute(): CollectionInterface
/**
* Returns a collection of threads found in the audit log.
*
* @return Collection|Thread[]
* @return CollectionInterface|Thread[]
*/
protected function getThreadsAttribute(): CollectionInterface
{
Expand All @@ -173,7 +173,7 @@ protected function getThreadsAttribute(): CollectionInterface
/**
* Returns a collection of users found in the audit log.
*
* @return Collection|User[]
* @return CollectionInterface|User[]
*/
protected function getUsersAttribute(): CollectionInterface
{
Expand All @@ -189,7 +189,7 @@ protected function getUsersAttribute(): CollectionInterface
/**
* Returns a collection of webhooks found in the audit log.
*
* @return Collection|Webhook[]
* @return CollectionInterface|Webhook[]
*/
protected function getWebhooksAttribute(): CollectionInterface
{
Expand All @@ -209,7 +209,7 @@ protected function getWebhooksAttribute(): CollectionInterface
*
* @throws \InvalidArgumentException
*
* @return Collection|Entry[]
* @return CollectionInterface|Entry[]
*/
public function searchByType(int $action_type): CollectionInterface
{
Expand Down
18 changes: 9 additions & 9 deletions src/Discord/Parts/Guild/AuditLog/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
*
* @link https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
*
* @property ?string $target_id ID of the affected entity (webhook, user, role, etc.).
* @property Collection $changes Changes made to the target_id.
* @property ?string $user_id The user who made the changes.
* @property-read User|null $user
* @property string $id ID of the entry.
* @property int $action_type Type of action that occurred.
* @property Options|null $options Additional info for certain action types.
* @property string|null $reason The reason for the change (0-512 characters).
* @property ?string $target_id ID of the affected entity (webhook, user, role, etc.).
* @property CollectionInterface $changes Changes made to the target_id.
* @property ?string $user_id The user who made the changes.
* @property-read User|null $user
* @property string $id ID of the entry.
* @property int $action_type Type of action that occurred.
* @property Options|null $options Additional info for certain action types.
* @property string|null $reason The reason for the change (0-512 characters).
*/
class Entry extends Part
{
Expand Down Expand Up @@ -122,7 +122,7 @@ protected function getUserAttribute(): ?User
*
* @link https://discord.com/developers/docs/resources/audit-log#audit-log-change-object
*
* @return Collection
* @return CollectionInterface
*/
protected function getChangesAttribute(): CollectionInterface
{
Expand Down
12 changes: 6 additions & 6 deletions src/Discord/Parts/Guild/AutoModeration/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
* @property int $event_type The rule event type.
* @property int $trigger_type The rule trigger type.
* @property object $trigger_metadata The rule trigger metadata (may contain `keyword_filter`, `regex_patterns`, `presets`, `allow_list`, `mention_total_limit` and `mention_raid_protection_enabled`).
* @property Collection|Action[] $actions The actions which will execute when the rule is triggered.
* @property CollectionInterface|Action[] $actions The actions which will execute when the rule is triggered.
* @property bool $enabled Whether the rule is enabled.
* @property Collection|?Role[] $exempt_roles The role ids that should not be affected by the rule (Maximum of 20).
* @property Collection|?Channel[] $exempt_channels The channel ids that should not be affected by the rule (Maximum of 50).
* @property CollectionInterface|?Role[] $exempt_roles The role ids that should not be affected by the rule (Maximum of 20).
* @property CollectionInterface|?Channel[] $exempt_channels The channel ids that should not be affected by the rule (Maximum of 50).
*/
class Rule extends Part
{
Expand Down Expand Up @@ -99,7 +99,7 @@ protected function getCreatorAttribute(): ?User
/**
* Returns the actions attribute.
*
* @return Collection|Action[] A collection of actions.
* @return CollectionInterface|Action[] A collection of actions.
*/
protected function getActionsAttribute(): CollectionInterface
{
Expand All @@ -115,7 +115,7 @@ protected function getActionsAttribute(): CollectionInterface
/**
* Returns the exempt roles attribute.
*
* @return Collection|?Role[] A collection of roles exempt from the rule.
* @return CollectionInterface|?Role[] A collection of roles exempt from the rule.
*/
protected function getExemptRolesAttribute(): CollectionInterface
{
Expand All @@ -139,7 +139,7 @@ protected function getExemptRolesAttribute(): CollectionInterface
/**
* Returns the exempt channels attribute.
*
* @return Collection|?Channel[] A collection of channels exempt from the rule.
* @return CollectionInterface|?Channel[] A collection of channels exempt from the rule.
*/
protected function getExemptChannelsAttribute(): CollectionInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Discord/Parts/Guild/CommandPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @property string $application_id The id of the application the command belongs to.
* @property string $guild_id The id of the guild.
* @property-read Guild|null $guild
* @property Collection|Permission[] $permissions The permissions for the command in the guild.
* @property CollectionInterface|Permission[] $permissions The permissions for the command in the guild.
*/
class CommandPermissions extends Part
{
Expand All @@ -56,7 +56,7 @@ protected function getGuildAttribute(): ?Guild
/**
* Gets the permissions attribute.
*
* @return Collection|Permission[] A collection of permissions.
* @return CollectionInterface|Permission[] A collection of permissions.
*/
protected function getPermissionsAttribute(): CollectionInterface
{
Expand Down
Loading

0 comments on commit 27d2bb7

Please sign in to comment.