Skip to content

Commit 94352a6

Browse files
committed
fix typehinting
1 parent d9e46cc commit 94352a6

39 files changed

+67
-62
lines changed

src/Discord/Parts/Channel/Message.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ public function delayedReply($message, int $delay, &$timer = null): ExtendedProm
908908
* @param int $delay Time to delay the delete by, in milliseconds.
909909
* @param TimerInterface &$timer Delay timer passed by reference.
910910
*
911-
* @return ExtendedPromseInterface
911+
* @return ExtendedPromiseInterface
912912
*/
913913
public function delayedDelete(int $delay, &$timer = null): ExtendedPromiseInterface
914914
{

src/Discord/Parts/Guild/AuditLog/AuditLog.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
*
3131
* @since 5.1.0
3232
*
33-
* @property Collection|Command[] $application_commands List of application commands referenced in the audit log.
34-
* @property Collection|Entry[] $audit_log_entries List of audit log entries.
35-
* @property Collection|Rule[] $auto_moderation_rules List of auto moderation rules referenced in the audit log.
36-
* @property Collection|GuildScheduledEvent[] $guild_scheduled_events List of guild scheduled events referenced in the audit log.
37-
* @property Collection|Integration[] $integrations List of partial integration objects.
38-
* @property Collection|Threads[] $threads List of threads referenced in the audit log.
39-
* @property Collection|User[] $users List of users referenced in the audit log.
40-
* @property Collection|Webhook[] $webhooks List of webhooks referenced in the audit log.
33+
* @property Collection|Command[] $application_commands List of application commands referenced in the audit log.
34+
* @property Collection|Entry[] $audit_log_entries List of audit log entries.
35+
* @property Collection|Rule[] $auto_moderation_rules List of auto moderation rules referenced in the audit log.
36+
* @property Collection|ScheduledEvent[] $guild_scheduled_events List of guild scheduled events referenced in the audit log.
37+
* @property Collection|Integration[] $integrations List of partial integration objects.
38+
* @property Collection|Thread[] $threads List of threads referenced in the audit log.
39+
* @property Collection|User[] $users List of users referenced in the audit log.
40+
* @property Collection|Webhook[] $webhooks List of webhooks referenced in the audit log.
4141
*
4242
* @property string $guild_id
4343
* @property-read Guild|null $guild

src/Discord/Parts/Guild/AutoModeration/Rule.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
namespace Discord\Parts\Guild\AutoModeration;
1313

1414
use Discord\Helpers\Collection;
15+
use Discord\Parts\Channel\Channel;
1516
use Discord\Parts\Guild\Guild;
17+
use Discord\Parts\Guild\Role;
1618
use Discord\Parts\Part;
1719
use Discord\Parts\User\User;
1820

@@ -39,8 +41,8 @@
3941
* @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`).
4042
* @property Collection|Action[] $actions The actions which will execute when the rule is triggered.
4143
* @property bool $enabled Whether the rule is enabled.
42-
* @property Collection|Roles[] $exempt_roles The role ids that should not be affected by the rule (Maximum of 20).
43-
* @property Collection|Channels[] $exempt_channels The channel ids that should not be affected by the rule (Maximum of 50).
44+
* @property Collection|?Role[] $exempt_roles The role ids that should not be affected by the rule (Maximum of 20).
45+
* @property Collection|?Channel[] $exempt_channels The channel ids that should not be affected by the rule (Maximum of 50).
4446
*/
4547
class Rule extends Part
4648
{
@@ -111,7 +113,7 @@ protected function getActionsAttribute(): Collection
111113
/**
112114
* Returns the exempt roles attribute.
113115
*
114-
* @return Collection<?Role> A collection of roles exempt from the rule.
116+
* @return Collection|?Role[] A collection of roles exempt from the rule.
115117
*/
116118
protected function getExemptRolesAttribute(): Collection
117119
{
@@ -135,7 +137,7 @@ protected function getExemptRolesAttribute(): Collection
135137
/**
136138
* Returns the exempt channels attribute.
137139
*
138-
* @return Collection<?Channel> A collection of channels exempt from the rule.
140+
* @return Collection|?Channel[] A collection of channels exempt from the rule.
139141
*/
140142
protected function getExemptChannelsAttribute(): Collection
141143
{

src/Discord/Parts/Interactions/Interaction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Discord\Parts\Interactions\Request\InteractionData;
2727
use Discord\Parts\Part;
2828
use Discord\Parts\Permissions\ChannelPermission;
29+
use Discord\Parts\Thread\Thread;
2930
use Discord\Parts\User\Member;
3031
use Discord\Parts\User\User;
3132
use Discord\WebSockets\Event;

src/Discord/Parts/User/User.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ public function getPrivateChannel(): ExtendedPromiseInterface
128128
*
129129
* @link https://discord.com/developers/docs/resources/channel#create-message
130130
*
131-
* @param MessageBuilder|string $message The message builder that should be converted into a message, or the string content of the message.
132-
* @param bool $tts Whether the message is TTS.
133-
* @param Embed|array|null $embed An embed object or array to send in the message.
134-
* @param array|null $allowed_mentions Allowed mentions object for the message.
135-
* @param Message|null $replyTo Sends the message as a reply to the given message instance.
131+
* @param MessageBuilder|string $message The message builder that should be converted into a message, or the string content of the message.
132+
* @param bool $tts Whether the message is TTS.
133+
* @param \Discord\Parts\Embed\Embed|array|null $embed An embed object or array to send in the message.
134+
* @param array|null $allowed_mentions Allowed mentions object for the message.
135+
* @param Message|null $replyTo Sends the message as a reply to the given message instance.
136136
*
137137
* @return ExtendedPromiseInterface<Message>
138138
*/

src/Discord/Parts/WebSockets/MessageReaction.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Discord\Parts\Guild\Emoji;
1818
use Discord\Parts\Guild\Guild;
1919
use Discord\Parts\Part;
20+
use Discord\Parts\Thread\Thread;
2021
use Discord\Parts\User\Member;
2122
use Discord\Parts\User\User;
2223
use React\Promise\ExtendedPromiseInterface;
@@ -31,16 +32,16 @@
3132
*
3233
* @since 5.0.0
3334
*
34-
* @property string|null $user_id ID of the user that performed the reaction.
35-
* @property User|null $user User that performed the reaction.
36-
* @property string $channel_id ID of the channel that the reaction was performed in.
37-
* @property-read Channel|Thread $channel Channel that the reaction was performed in.
38-
* @property string $message_id ID of the message that the reaction was placed on.
39-
* @property Message|null $message Message that the reaction was placed on, null if not cached.
40-
* @property string|null $guild_id ID of the guild that owns the channel.
41-
* @property-read Guild|null $guild Guild that owns the channel.
42-
* @property Member|null $member Member object of the user that performed the reaction, null if not cached or DM channel.
43-
* @property Emoji|null $emoji The emoji that was used as the reaction.
35+
* @property string|null $user_id ID of the user that performed the reaction.
36+
* @property User|null $user User that performed the reaction.
37+
* @property string $channel_id ID of the channel that the reaction was performed in.
38+
* @property-read Channel|Thread|null $channel Channel that the reaction was performed in.
39+
* @property string $message_id ID of the message that the reaction was placed on.
40+
* @property Message|null $message Message that the reaction was placed on, null if not cached.
41+
* @property string|null $guild_id ID of the guild that owns the channel.
42+
* @property-read Guild|null $guild Guild that owns the channel.
43+
* @property Member|null $member Member object of the user that performed the reaction, null if not cached or DM channel.
44+
* @property Emoji|null $emoji The emoji that was used as the reaction.
4445
*
4546
* @property string $reaction_id ID of the reaction.
4647
*/
@@ -133,9 +134,9 @@ protected function getUserAttribute(): ?User
133134
/**
134135
* Gets the channel attribute.
135136
*
136-
* @return Channel|Thread
137+
* @return Channel|Thread|null
137138
*/
138-
protected function getChannelAttribute(): Part
139+
protected function getChannelAttribute(): ?Part
139140
{
140141
if ($guild = $this->guild) {
141142
$channels = $guild->channels;

src/Discord/Parts/WebSockets/TypingStart.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Carbon\Carbon;
1515
use Discord\Parts\Guild\Guild;
16+
use Discord\Parts\Thread\Thread;
1617
use Discord\Parts\User\Member;
1718
use Discord\Parts\Channel\Channel;
1819
use Discord\Parts\Part;

src/Discord/Repository/Channel/InviteRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @method Invite|null pull(string|int $key, $default = null)
2828
* @method Invite|null first()
2929
* @method Invite|null last()
30-
* @method Invite|null find()
30+
* @method Invite|null find(callable $callback)
3131
*/
3232
class InviteRepository extends AbstractRepository
3333
{

src/Discord/Repository/Channel/MessageRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @method Message|null pull(string|int $key, $default = null)
2929
* @method Message|null first()
3030
* @method Message|null last()
31-
* @method Message|null find()
31+
* @method Message|null find(callable $callback)
3232
*/
3333
class MessageRepository extends AbstractRepository
3434
{

src/Discord/Repository/Channel/OverwriteRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @method Overwrite|null pull(string|int $key, $default = null)
2828
* @method Overwrite|null first()
2929
* @method Overwrite|null last()
30-
* @method Overwrite|null find()
30+
* @method Overwrite|null find(callable $callback)
3131
*/
3232
class OverwriteRepository extends AbstractRepository
3333
{

0 commit comments

Comments
 (0)