Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit f51200e

Browse files
committed
force getFeature to always return an array, even if the feature is not found
1 parent 33a65db commit f51200e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Unleash.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ public function getFeatures(): array
5858
return $this->features;
5959
}
6060

61-
public function getFeature(string $name)
61+
public function getFeature(string $name): array
6262
{
6363
$features = $this->getFeatures();
6464

65-
return Arr::first(
65+
return (array) Arr::first(
6666
$features,
6767
function (array $unleashFeature) use ($name) {
6868
return $name === $unleashFeature['name'];

0 commit comments

Comments
 (0)