Skip to content

How should I use notEmpty? #574

@hirasso

Description

@hirasso

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions