Skip to content

Commit

Permalink
Add missing method to CollectionTrait and fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Dec 24, 2024
1 parent 5518bf7 commit 19ecc27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 12 additions & 0 deletions src/Discord/Helpers/CollectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,18 @@ public function toArray()
return $this->items;
}

/**
* @since 11.0.0
*
* Get the keys of the items.
*
* @return int[]|string[]
*/
public function keys(): array
{
return array_keys($this->items);
}

/**
* If the collection has an offset.
*
Expand Down
10 changes: 0 additions & 10 deletions src/Discord/Repository/AbstractRepositoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Discord\Discord;
use Discord\Factory\Factory;
use Discord\Helpers\CacheWrapper;
use Discord\Helpers\Collection;
use Discord\Helpers\CollectionInterface;
use Discord\Helpers\CollectionTrait;
use Discord\Helpers\LegacyCacheWrapper;
Expand Down Expand Up @@ -47,17 +46,9 @@ trait AbstractRepositoryTrait

// 'Parent' methods
__construct as __Collection____construct;
freshen as __Collection__freshen;
create as __Collection__create;
save as __Collection__save;
delete as __Collection__delete;
fresh as __Collection__fresh;
fetch as __Collection__fetch;
get as __Collection__get;
cacheGet as __Collection__cacheGet;
set as __Collection__set;
pull as __Collection__pull;
cachePull as __Collection__cachePull;
pushItem as __Collection__pushItem;
first as __Collection__first;
last as __Collection__last;
Expand All @@ -73,7 +64,6 @@ trait AbstractRepositoryTrait
offsetUnset as __Collection__offsetUnset;
jsonSerialize as __Collection__jsonSerialize;
getIterator as __Collection__getIterator;
__get as __Collection____get;
}
/**
* The collection discriminator.
Expand Down

0 comments on commit 19ecc27

Please sign in to comment.