Skip to content

Commit

Permalink
PromiseInterface return types
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Nov 20, 2024
1 parent de95307 commit 3cd3581
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Discord/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ public function getVoiceClient(string $guild_id): ?VoiceClient
* @since 10.0.0 Removed argument $check that has no effect (it is always checked)
* @since 4.0.0
*
* @return ExtendedPromiseInterface<VoiceClient>
* @return PromiseInterface<VoiceClient>
*/
public function joinVoiceChannel(Channel $channel, $mute = false, $deaf = true, ?LoggerInterface $logger = null, bool $check = true): PromiseInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Parts/Channel/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ public function delayedReply($message, int $delay, &$timer = null): PromiseInter
* @param int $delay Time to delay the delete by, in milliseconds.
* @param TimerInterface &$timer Delay timer passed by reference.
*
* @return ExtendedPromiseInterface
* @return PromiseInterface
*/
public function delayedDelete(int $delay, &$timer = null): PromiseInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Discord/Parts/Channel/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Discord\Parts\Channel\Poll\PollResults;
use Discord\Parts\Part;
use Discord\Repository\Channel\PollAnswerRepository;
use React\Promise\ExtendedPromiseInterface;
use React\Promise\PromiseInterface;

/**
* A message poll.
Expand Down Expand Up @@ -128,9 +128,9 @@ protected function getResultsAttribute(): ?PollResults
*
* @link https://discord.com/developers/docs/resources/poll#end-poll
*
* @return ExtendedPromiseInterface<Message>
* @return PromiseInterface<Message>
*/
public function expire(): ExtendedPromiseInterface
public function expire(): PromiseInterface
{
return $this->http->post(Endpoint::bind(Endpoint::MESSAGE_POLL_EXPIRE, $this->channel_id, $this->message_id))
->then(function ($response) {
Expand Down
6 changes: 3 additions & 3 deletions src/Discord/Parts/Channel/Poll/PollAnswer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Discord\Parts\Part;
use Discord\Parts\Thread\Thread;
use Discord\Parts\User\User;
use React\Promise\ExtendedPromiseInterface;
use React\Promise\PromiseInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

use function Discord\normalizePartId;
Expand Down Expand Up @@ -140,9 +140,9 @@ protected function getGuildAttribute(): ?Guild
*
* @throws \OutOfRangeException
*
* @return ExtendedPromiseInterface<Collection|User[]>
* @return PromiseInterface<Collection|User[]>
*/
public function getVoters(array $options = []): ExtendedPromiseInterface
public function getVoters(array $options = []): PromiseInterface
{
$query = Endpoint::bind(Endpoint::MESSAGE_POLL_ANSWER, $this->channel_id, $this->message_id, $this->answer_id);

Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Parts/Interactions/Interaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ protected function respond(array $payload, ?Multipart $multipart = null): Promis
*
* @return PromiseInterface<Message>
*/
public function updateFollowUpMessage(string $message_id, MessageBuilder $builder): ExtendedPromiseInterface
public function updateFollowUpMessage(string $message_id, MessageBuilder $builder): PromiseInterface
{
if (! $this->responded) {
return reject(new \RuntimeException('Cannot create a follow-up message as the interaction has not been responded to.'));
Expand Down
4 changes: 2 additions & 2 deletions src/Discord/Parts/User/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ public function ban(?int $daysToDeleteMessages = null, ?string $reason = null):
* @throws \RuntimeException Member has no `$guild`.
* @throws NoPermissionsException Missing `kick_members` permission.
*
* @return ExtendedPromiseInterface<self>
* @return PromiseInterface<self>
*/
public function kick(?string $reason = null): ExtendedPromiseInterface
public function kick(?string $reason = null): PromiseInterface
{
return $this->discord->guilds->cacheGet($this->guild_id)->then(function (?Guild $guild) use ($reason) {
if (null === $guild) {
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Repository/Channel/PollAnswerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Discord\Http\Endpoint;
use Discord\Parts\Channel\Poll\PollAnswer;
use Discord\Repository\AbstractRepository;
use React\Promise\ExtendedPromiseInterface;
use React\Promise\PromiseInterface;

/**
* Contains poll answers on a poll in a message.
Expand Down
6 changes: 3 additions & 3 deletions src/Discord/Repository/EmojiRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Discord\Discord;
use Discord\Http\Endpoint;
use Discord\Parts\Guild\Emoji;
use React\Promise\ExtendedPromiseInterface;
use React\Promise\PromiseInterface;

use function React\Promise\resolve;

Expand Down Expand Up @@ -63,9 +63,9 @@ public function __construct(Discord $discord, array $vars = [])
/**
* @param object $response
*
* @return ExtendedPromiseInterface<static>
* @return PromiseInterface<static>
*/
protected function cacheFreshen($response): ExtendedPromiseInterface
protected function cacheFreshen($response): PromiseInterface
{
foreach ($response as $value) foreach ($value as $value) {
$value = array_merge($this->vars, (array) $value);
Expand Down
6 changes: 3 additions & 3 deletions src/Discord/Repository/Guild/SoundRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Discord\Http\Endpoint;
use Discord\Parts\Guild\Sound;
use Discord\Repository\AbstractRepository;
use React\Promise\ExtendedPromiseInterface;
use React\Promise\PromiseInterface;

use function React\Promise\resolve;

Expand Down Expand Up @@ -60,9 +60,9 @@ class SoundRepository extends AbstractRepository
/**
* @param object $response
*
* @return ExtendedPromiseInterface<static>
* @return PromiseInterface<static>
*/
protected function cacheFreshen($response): ExtendedPromiseInterface
protected function cacheFreshen($response): PromiseInterface
{
foreach ($response as $value) foreach ($value as $value) {
$value = array_merge($this->vars, (array) $value);
Expand Down

0 comments on commit 3cd3581

Please sign in to comment.