Skip to content

Added Validator for allowedRegexvalues - #370

Closed
treestonemedia wants to merge 3 commits into
phpdotenv:masterfrom
treestonemedia:regexValidator
Closed

treestonemedia wants to merge 3 commits into
phpdotenv:masterfrom
treestonemedia:regexValidator

Conversation

@treestonemedia

Copy link
Copy Markdown
Contributor
  • Added a function to check if an env variable's value matches a given regex.
  • This was required for our project and I think is a nice addition to this amazing tool.
  • Also added a test for allowedRegexValues().
  • Also added a readme block.

@GrahamCampbell

Copy link
Copy Markdown
Collaborator

Thanks for the PR. I wonder if we should require exactly one match, rather than at least 1? In your usage, which behaviour would be most useful?

@treestonemedia

Copy link
Copy Markdown
Contributor Author

@GrahamCampbell good point - that was an oversight on my part - updated the PR

@GrahamCampbell

GrahamCampbell commented Sep 10, 2019 •

Copy link
Copy Markdown
Collaborator

Perfect. I've made some tweaks, and merged this into master (1bdf24f).

@GrahamCampbell

Copy link
Copy Markdown
Collaborator

This will be included in the v3.6.0 release. Thanks for the contribution! 🎉

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

Successfully merging this pull request may close these issues.

2 participants