Skip to content

Commit

Permalink
Added the Features::findByName() method
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Feb 21, 2024
1 parent b5e3ae2 commit 9cd4eab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Support/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Vanilo\Support;

use Vanilo\Contracts\Feature;
use Vanilo\Support\Features\MultiChannel;
use Vanilo\Support\Features\Pricing;

Expand All @@ -23,6 +24,15 @@ class Features

private static ?Pricing $pricing = null;

public static function findByName(string $name): ?Feature
{
return match ($name) {
'pricing' => self::pricing(),
'multichannel' => self::multichannel(),
default => null,
};
}

public static function multichannel(): MultiChannel
{
return self::$multiChannel ?: (self::$multiChannel = new MultiChannel());
Expand Down

0 comments on commit 9cd4eab

Please sign in to comment.