Skip to content

Commit 9bafb47

Browse files
committed
fix: update PHP requirement to 8.1+ for enum support
The library uses enum syntax which requires PHP 8.1+. Updated: - composer.json: PHP requirement from ^8.0 to ^8.1 - GitHub Actions: Test matrix from 8.0-8.4 to 8.1-8.4 - README.md: Updated requirements and version info - Restored enum test (now compatible with minimum PHP version) All 29 tests passing locally.
1 parent ec11af4 commit 9bafb47

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: true
2222
matrix:
2323
os: [ubuntu-latest, windows-latest]
24-
php: [8.0, 8.1, 8.2, 8.3, 8.4]
24+
php: [8.1, 8.2, 8.3, 8.4]
2525
stability: [prefer-lowest, prefer-stable]
2626

2727
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ composer require iamgerwin/toon-php
4848
```
4949

5050
**Requirements:**
51-
- PHP 8.0+ (v2.x - Latest)
51+
- PHP 8.1+ (v2.x - Latest)
5252
- PHP 7.0-7.4 (v1.x - Coming soon)
5353

5454
## Quick Start
@@ -273,10 +273,10 @@ This package maintains the highest quality standards:
273273

274274
-**PHPStan Level 6** (strict static analysis)
275275
-**PSR-12** code style compliance
276-
-**100% test coverage** (33 tests, 67 assertions)
276+
-**100% test coverage** (29 tests, 63 assertions)
277277
-**Zero dependencies** (pure PHP)
278278
-**Continuous Integration** (GitHub Actions)
279-
-**Multi-version testing** (PHP 8.0-8.4)
279+
-**Multi-version testing** (PHP 8.1-8.4)
280280

281281
```bash
282282
composer test # Run Pest test suite
@@ -339,7 +339,7 @@ Contributions are welcome! This package follows:
339339

340340
## Versioning
341341

342-
- **v2.x** (Latest): PHP 8.0-8.4 with modern features
342+
- **v2.x** (Latest): PHP 8.1-8.4 with modern features
343343
- **v1.x** (Planned): PHP 7.0-7.4 compatibility
344344

345345
Composer automatically selects the right version for your PHP installation.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020
],
2121
"require": {
22-
"php": "^8.0"
22+
"php": "^8.1"
2323
},
2424
"require-dev": {
2525
"pestphp/pest": "^1.21|^2.0",

tests/ToonTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,17 @@
9999
expect($encoded)->toContain('2024-01-01');
100100
});
101101

102-
// Enum test skipped - requires PHP 8.1+ and would cause parse errors on PHP 8.0
102+
it('handles enums', function () {
103+
enum Status: string
104+
{
105+
case Active = 'active';
106+
case Inactive = 'inactive';
107+
}
108+
109+
$data = ['status' => Status::Active];
110+
$encoded = Toon::encode($data);
111+
expect($encoded)->toContain('active');
112+
});
103113

104114
it('handles empty arrays', function () {
105115
$encoded = Toon::encode([]);

0 commit comments

Comments
 (0)