A lightweight and efficient PHP helper library for managing environment variables with a clean and simple API.
To install this package using Composer:
composer require imponeer/envFor manual installation, clone this repository and include the files from the src/ directory in your project.
// Get an environment variable with a default value
$path = env('APP_PATH', '/var/www');
// Get a boolean environment variable
$isDebug = (bool) env('APP_DEBUG', false);
// Get an integer value
$port = (int) env('APP_PORT', 8080);This project uses several tools to ensure code quality and reliability. Here are the available commands:
Run Unit Tests Execute the test suite using PHPUnit:
composer testCheck Code Style Verify code adheres to PSR-12 standards:
composer phpcsFix Code Style Issues Automatically fix code style violations:
composer phpcbfRun Static Analysis Perform static code analysis with PHPStan:
composer phpstanWe welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes following PSR-12 coding standards
- Add tests for your changes
- Run the test suite:
composer test - Check code style:
composer phpcs - Fix any style issues:
composer phpcbf - Run static analysis:
composer phpstan - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Open a pull request
Found a bug or have a feature request? Please open an issue on our GitHub Issues page.
This project is licensed under the MIT License - see the LICENSE file for details.