Skip to content

Commit 20579e0

Browse files
committed
Add GitHub Actions for testing, update PHP requirement, and README
1 parent 659b8e9 commit 20579e0

3 files changed

Lines changed: 88 additions & 1 deletion

File tree

.github/workflows/test.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: test
2+
3+
on: [push, pull_request]
4+
5+
permissions: {}
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
php-version: ['8.4']
13+
steps:
14+
- uses: actions/checkout@v5
15+
with:
16+
persist-credentials: false
17+
18+
- name: Setup PHP ${{ matrix.php-version }}
19+
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
20+
with:
21+
php-version: ${{ matrix.php-version }}
22+
coverage: pcov
23+
24+
- name: Install dependencies
25+
run: composer install --no-interaction --prefer-dist
26+
27+
- name: Run tests
28+
run: vendor/bin/phpunit
29+
30+
- name: Run tests with coverage
31+
run: vendor/bin/phpunit --coverage-text

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# maml-php
2+
3+
A modern, well‑tested implementation of the [MAML](https://maml.dev) data format for PHP.
4+
5+
- Spec‑accurate parser and pretty serializer
6+
- Zero dependencies
7+
- 100% test coverage (classes, methods, lines)
8+
9+
## Installation
10+
11+
```
12+
composer require maml/maml
13+
```
14+
15+
## Usage
16+
17+
```php
18+
use Maml\Maml;
19+
20+
$data = Maml::parse('{
21+
project: "MAML"
22+
tags: [
23+
"minimal"
24+
"readable"
25+
]
26+
27+
# A simple nested object
28+
spec: {
29+
version: 1
30+
author: "Anton Medvedev"
31+
}
32+
33+
notes: """
34+
This is a raw multiline string.
35+
Keeps formatting as‑is.
36+
"""
37+
}');
38+
39+
echo $data['project']; // "MAML"
40+
41+
$text = Maml::stringify(['foo' => 'bar', 'list' => [1, 2, 3]]);
42+
/*
43+
{
44+
foo: "bar"
45+
list: [
46+
1
47+
2
48+
3
49+
]
50+
}
51+
*/
52+
```
53+
54+
## License
55+
56+
[MIT](LICENSE)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=8.4",
23+
"php": ">=8",
2424
"ext-mbstring": "*"
2525
},
2626
"require-dev": {

0 commit comments

Comments
 (0)