Skip to content

Commit 626f72f

Browse files
committed
Add PHP lint script and workflow
1 parent e8141ba commit 626f72f

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.github/workflows/php-lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PHP Lint
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.php'
7+
- '.github/workflows/php-lint.yml'
8+
pull_request:
9+
paths:
10+
- '**/*.php'
11+
- '.github/workflows/php-lint.yml'
12+
13+
jobs:
14+
phplint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Run php -l on all files
19+
run: |
20+
find . -name '*.php' -print0 | xargs -0 -n 1 php -l

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ Microfy::c('Step A');
136136
```
137137

138138
More [Examples](https://itnb.com/MicrofyClass/)
139+
## ✅ Lint Check
140+
141+
Run PHP's built-in linter across all project files:
142+
143+
```bash
144+
./scripts/lint.sh
145+
```
146+
139147

140148
---
141149

scripts/lint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Lint all PHP files in the repository
5+
find . -name '*.php' -print0 | xargs -0 -n 1 php -l

0 commit comments

Comments
 (0)