Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I use notEmpty? #574

Open
hirasso opened this issue Sep 19, 2024 · 0 comments
Open

How should I use notEmpty? #574

hirasso opened this issue Sep 19, 2024 · 0 comments

Comments

@hirasso
Copy link

hirasso commented Sep 19, 2024

Hi there! I'd love to have a way to do this:

$dotenv->notEmpty(['MY_FIRST_VAR', 'MY_SECOND_VAR']);

...with the same behavior as $dotenv->required.

The function is already there, but there doesn't seem to be a public API:

public function notEmpty()
{
return $this->assertNullable(
static function (string $value) {
return Str::len(\trim($value)) > 0;
},
'is empty'
);
}

I'd submit a PR if you accept one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant