PHPackages                             selevia/env-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. selevia/env-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

selevia/env-validator
=====================

The script for validate env variables

v1.0.1(4y ago)223Copyright SeleviaPHPPHP ^7.3 | ^8.0.0CI failing

Since Jun 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Selevia/env-validator)[ Packagist](https://packagist.org/packages/selevia/env-validator)[ RSS](/packages/selevia-env-validator/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

Env Validator
=============

[](#env-validator)

Env Validator is a utility for comparing the **expected** environment variables (usually defined in a `.env.example` file) with the **actual** environment variables (usually loaded from a `.env` file) that are present at runtime.

Installation
------------

[](#installation)

Install via composer:

```
composer require selevia/env-validator
```

Usage
-----

[](#usage)

As your project grows, your infrastructure concerns change, and so does the `.env.example` file. Use the `env-validator` utility to validate that your environment has been configured correctly.

Simply add a script to your `composer.json`:

```
{
  "scripts": {
    "env-validator": "env-validator"
  }
}
```

and run it:

```
composer env-validator
```

or, alternatively, run the executable directly:

```
vendor/bin/env-validator
```

Options
-------

[](#options)

By default, the utility looks for `.env` and `.env.example` files in the root directory of your project.

If you want to change the default filenames use the following options:

- `--actual` (`-a`) for the actual file.
- `--expected` (`-e`) for the expected file.

Example:

```
vendor/bin/env-validator --actual=.env.dev --expected=.env.template
```

Output
------

[](#output)

The very first line will be a summary of each Status type (i.e. Success, Warning, and Error). Below the summary, all the Error and Warning cases will be outputted, if any.

Statuses
--------

[](#statuses)

Each environment variable defined *in both files* will be given a Status

TypeOutput MessageExplanationErrorExpected env var ENV\_VAR\_NAME was completely missingThe variable is missing. This means it was defined in the expected file, but not in the actual one.WarningUnexpected env var ENV\_VAR\_NAME encounteredThe variable is unexpected. This means it was present in the actual file, but it was not defined in the expected file.WarningEnv var ENV\_VAR\_NAME was present, but the value was emptyThe variable is blank. This means it was defined in the expected file and present in the actual file, but the value was blank.SuccessN/AEverything is okay

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 58.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~345 days

Total

2

Last Release

1815d ago

PHP version history (2 changes)v1.0.0PHP ^7.3

v1.0.1PHP ^7.3 | ^8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ea02a11d96ca3945c4a13ad50f39144ff2a7500fef786a83cca51274063c8af?d=identicon)[selevia](/maintainers/selevia)

---

Top Contributors

[![Bazikyan](https://avatars.githubusercontent.com/u/32932344?v=4)](https://github.com/Bazikyan "Bazikyan (21 commits)")[![shadyan](https://avatars.githubusercontent.com/u/11218993?v=4)](https://github.com/shadyan "shadyan (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/selevia-env-validator/health.svg)

```
[![Health](https://phpackages.com/badges/selevia-env-validator/health.svg)](https://phpackages.com/packages/selevia-env-validator)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)[eniams/safe-migrations

Warn you when a migration is unsafe

56237.5k](/packages/eniams-safe-migrations)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
