Skip to content

Commit af6243b

Browse files
committed
chore: Update .gitignore and CHANGELOG.md for environment file synchronization feature and documentation improvements
1 parent ca1ecf6 commit af6243b

17 files changed

Lines changed: 2885 additions & 61 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
/.idea/
88
*.swp
99
*.swo
10+
*.env
11+
*.env.example
12+
.DS_Store

CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,72 @@ All notable changes to `env-validator` will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2025-05-27
9+
10+
### :bug: Fixed
11+
12+
- **Critical Fix**: Required field validation now works correctly with array rules in standalone PHP
13+
- Fixed `StandaloneValidator::isRequiredAndMissing()` to properly handle array rules like `['required', 'string']`
14+
- Previously only worked with string rules like `'required|string'`
15+
- Now both `['required', 'string']` and `'required|string'` formats work correctly
16+
- Ensures missing required environment variables are properly detected and reported
17+
18+
### :art: Added
19+
20+
- **Environment File Synchronization System** - Complete solution for keeping `.env` and `.env.example` synchronized
21+
- **New Service**: `EnvExampleSyncService` with intelligent categorization and security features
22+
- **New Command**: `php artisan env:sync` with multiple options (`--check`, `--force`, `--no-values`, `--remove-extra`)
23+
- **New Facade**: `EnvSync` for programmatic usage in applications
24+
- **Standalone PHP Support**: Works seamlessly in non-Laravel applications with explicit path configuration
25+
- **Security Features**: Automatic sensitive data masking and smart example value generation
26+
- **28 comprehensive tests** covering all sync scenarios and edge cases
27+
- **New Example File**: `examples/required_field_examples.php` - Comprehensive required field validation examples
28+
- Demonstrates different rule formats (array vs string)
29+
- Shows required vs optional field handling
30+
- Includes real-world production scenarios
31+
- Covers custom error messages for required fields
32+
- Best practices and troubleshooting guide
33+
- **New Example File**: `examples/env_sync_examples.php` - Complete environment synchronization demonstrations
34+
- Shows real-world scenarios where developers add new environment variables
35+
- Demonstrates security features and sensitive data handling
36+
- Includes CI/CD integration examples and best practices
37+
- Covers programmatic usage and validation rule suggestions
38+
- **New Example File**: `examples/standalone_env_sync_examples.php` - Standalone PHP environment synchronization
39+
- Comprehensive guide for using environment sync in non-Laravel applications
40+
- Demonstrates explicit path configuration and error handling
41+
- Shows integration with deployment scripts and validation workflows
42+
- Covers different project structures and best practices
43+
- **New Test File**: `tests/Unit/ReadmeExamplesTest.php` - Comprehensive test coverage for README examples
44+
- Tests both basic (string rules) and advanced (Rule objects) standalone examples
45+
- Validates required field validation section examples work correctly
46+
- Ensures mixed required/optional field scenarios work as documented
47+
- Verifies custom error message functionality in standalone mode
48+
- Guarantees all README code examples are functional and accurate
49+
50+
### :books: Improved
51+
52+
- **Enhanced Documentation**: Added comprehensive "Environment File Synchronization" section to README
53+
- Complete command reference with examples and sample outputs
54+
- **Standalone PHP Usage**: Detailed documentation for non-Laravel applications
55+
- Security features documentation with sensitive data handling
56+
- CI/CD integration examples and best practices
57+
- Programmatic usage with facade and service examples
58+
- Different project structure configurations and deployment script integration
59+
- Updated features list and package description to highlight sync capabilities
60+
- **Enhanced Documentation**: Added dedicated "Required Field Validation" section to README
61+
- Clear examples of both array and string rule formats
62+
- Explanation of when required validation fails
63+
- Updated examples section with new file listings
64+
- **Fixed README**: Corrected Standalone PHP Usage examples
65+
- Added missing `use` statements for Rule objects
66+
- Changed from `$validator->validate()` (Laravel) to `EnvValidator::validateStandalone()` (standalone)
67+
- Added both basic (string rules) and advanced (rule objects) examples
68+
- All examples now work correctly without fatal errors
69+
70+
---
71+
72+
[1.1.0]: https://github.com/dev-kraken/env-validator/releases/tag/v1.1.0
73+
874
## [1.0.0] - 2025-05-26
975

1076
### :rocket: Initial Release

0 commit comments

Comments
 (0)