Skip to content

Commit

Permalink
Refactor docstrings and filter item list
Browse files Browse the repository at this point in the history
  • Loading branch information
abmmhasan committed Dec 7, 2023
1 parent b1e5680 commit 4fb1d30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Draw/GrandDraw.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GrandDraw
* Sets the file path for the user list.
*
* @param string $userListFilePath The file path for the user list.
* @return GrandDraw Returns the BucketDraw instance.
* @return GrandDraw Returns the instance.
* @throws Exception If the file does not exist.
*/
public function setUserListFilePath(string $userListFilePath): GrandDraw
Expand All @@ -32,7 +32,7 @@ public function setUserListFilePath(string $userListFilePath): GrandDraw
* Sets the items for the BucketDraw object.
*
* @param array $items The array of items to be set.
* @return GrandDraw The updated BucketDraw object.
* @return GrandDraw The updated object.
*/
public function setItems(array $items): GrandDraw
{
Expand Down
2 changes: 1 addition & 1 deletion src/Draw/LuckyDraw.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private function check(): void
public function pick(bool $check = true): array
{
$check && $this->check();
$items = array_column($this->items, 'chances', 'item');
$items = array_filter(array_column($this->items, 'chances', 'item'));
$items = $this->prepare($items);
$pickedItem = $this->draw($items);
$amounts = $this->items[array_search($pickedItem, array_column($this->items, 'item'))]['amounts'];
Expand Down

0 comments on commit 4fb1d30

Please sign in to comment.