clean code
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user