Skip to content

Commit

Permalink
Replace local collect call with array helper
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Apr 9, 2024
1 parent ed72df6 commit 89d735d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/framework/src/Facades/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Hyde\Foundation\Concerns\Feature;
use Hyde\Support\Concerns\Serializable;
use Hyde\Support\Contracts\SerializableContract;
use Illuminate\Support\Arr;

use function is_array;
use function array_map;
Expand Down Expand Up @@ -138,10 +139,9 @@ public static function hasTorchlight(): bool
*/
public function toArray(): array
{
return collect(Feature::cases())
->mapWithKeys(fn (Feature $feature): array => [
$feature->value => in_array($feature->value, $this->features),
])->toArray();
return Arr::mapWithKeys(Feature::cases(), fn (Feature $feature): array => [
$feature->value => in_array($feature->value, $this->features),
]);
}

protected function boot(): array
Expand Down

0 comments on commit 89d735d

Please sign in to comment.