clean code

This commit is contained in:
2024-11-10 00:50:07 +05:00
parent c0a94da482
commit 3f4c00f970
4 changed files with 66 additions and 57 deletions

View File

@@ -31,15 +31,18 @@ class BankRepository
/**
* Return available options
*
* @return Collection<array-key, mixed>|array<string, string>
* @return Collection<int|string, string>|array<string, string>
*/
public function options(): Collection|array
{
return CacheRepository::make(
/** @var Collection<int|string, string> */
$options = CacheRepository::make(
name: static::$cacheName.'_options',
value: fn () => $this->query->get(['id', 'name', 'bab'])->mapWithKeys(fn ($item) => [
$item->id => $item->name.' - '.$item->bab,
]),
);
return $options;
}
}