Skip to content

Commit

Permalink
Merge branch 'master' into v11
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming authored Dec 24, 2024
2 parents e5d8c46 + f07ffa2 commit a4ef2a7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/Discord/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;
use Monolog\Logger as Monolog;
use Monolog\Level;
use Psr\Log\LoggerInterface;
use Ratchet\Client\Connector;
use Ratchet\Client\WebSocket;
Expand Down Expand Up @@ -1455,7 +1454,7 @@ protected function resolveOptions(array $options = []): array
$options['loop'] ??= Loop::get();

if (null === $options['logger']) {
$streamHandler = new StreamHandler('php://stdout', Level::Debug);
$streamHandler = new StreamHandler('php://stdout', Monolog::DEBUG);
$lineFormatter = new LineFormatter(null, null, true, true);
$streamHandler->setFormatter($lineFormatter);
$logger = new Monolog('DiscordPHP', [$streamHandler]);
Expand Down
6 changes: 4 additions & 2 deletions src/Discord/Helpers/CollectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,11 @@ public function has(...$keys): bool
*
* @param callable $callback
*
* @return static
* @return CollectionInterface
*
* @todo This method will be typed to return a CollectionInterface in v11
*/
public function filter(callable $callback): static
public function filter(callable $callback)
{
$collection = new static([], $this->discrim, $this->class);

Expand Down
13 changes: 0 additions & 13 deletions src/Discord/Repository/AbstractRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,7 @@

namespace Discord\Repository;

use Discord\Helpers\CacheWrapper;
use Discord\Helpers\CollectionInterface;
use Discord\Helpers\CollectionTrait;
use Discord\Helpers\LegacyCacheWrapper;
use Discord\Http\Endpoint;
use Discord\Http\Http;
use Discord\Parts\Part;
use React\Promise\PromiseInterface;
use Traversable;
use WeakReference;

use function Discord\nowait;
use function React\Promise\reject;
use function React\Promise\resolve;

/**
* Repositories provide a way to store and update parts on the Discord server.
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Repository/AbstractRepositoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ public function has(...$keys): bool
*
* @return CollectionInterface
*/
public function filter(callable $callback): CollectionInterface
public function filter(callable $callback)
{
$collection = new ($this->discord->getCollectionClass())([], $this->discrim, $this->class);

Expand Down

0 comments on commit a4ef2a7

Please sign in to comment.