JetBrains / JetBrains/idea-php-dotenv-plugin

[Feature] Add support for custom env reader functions

Open
#80 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
189
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Right now the plugin works great with laravel using `env('SOMETHING')`.

However I like to create a second helper for when the app just won't run without an environment variable defined.

```php
function env_or_throw($key, $default = null)
{
return env(
$key,
$default ?? fn() => throw new \Exception("Missing require environment variable '{$key}'.")
);
}
```

It would be great if we could specify that `env_or_throw` or `my_special_env_function` was an `env` alias.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.