Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PHP Lint

on:
push:
paths:
- '**/*.php'
- '.github/workflows/php-lint.yml'
pull_request:
paths:
- '**/*.php'
- '.github/workflows/php-lint.yml'

jobs:
phplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run php -l on all files
run: |
find . -name '*.php' -print0 | xargs -0 -n 1 php -l
1 change: 1 addition & 0 deletions MicrofyClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public static function dbPdo($host, $dbname, $user, $pass, $charset = 'utf8mb4',
return new PDO($dsn, $user, $pass, $options);
} catch (PDOException $e) {
self::dd("PDO Connection failed: " . $e->getMessage());
return null;
}
}

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ Microfy::c('Step A');
```

More [Examples](https://itnb.com/MicrofyClass/)
## ✅ Lint Check

Run PHP's built-in linter across all project files:

```bash
./scripts/lint.sh
```


---

Expand Down
5 changes: 5 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

# Lint all PHP files in the repository
find . -name '*.php' -print0 | xargs -0 -n 1 php -l