. */ namespace FireflyIII\Support\Binder; use Illuminate\Routing\Route; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * Class EitherConfigKey */ class EitherConfigKey { public static array $static = [ 'firefly.version', 'firefly.api_version', 'firefly.default_location', 'firefly.account_to_transaction', 'firefly.allowed_opposing_types', 'firefly.accountRoles', 'firefly.valid_liabilities', 'firefly.interest_periods', 'firefly.bill_periods', 'firefly.enable_external_map', 'firefly.expected_source_types', 'app.timezone', ]; /** * @param string $value * @param Route $route * * @return string * @throws NotFoundHttpException */ public static function routeBinder(string $value, Route $route): string { if (in_array($value, self::$static, true) || in_array($value, DynamicConfigKey::$accepted, true)) { return $value; } throw new NotFoundHttpException; } }