Skip to content

Commit 28d12ab

Browse files
committed
chore: add pre-commit hooks for lint and update readme
1 parent 78ed984 commit 28d12ab

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

.githooks/pre-commit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Running lint..."
5+
./vendor/bin/pint --test
6+
7+
echo "Running static analysis..."
8+
./vendor/bin/phpstan analyse
9+
10+
echo "Running tests..."
11+
./vendor/bin/pest --coverage --min=100
12+
13+
echo "All checks passed."

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ try {
155155
| `NotFoundException` | 404 | No RDAP data found |
156156
| `RateLimitException` | 429 | Rate limit or quota exceeded |
157157
| `UpstreamException` | 502 | Upstream RDAP server failure |
158+
| `TemporarilyUnavailableException` | 503 | Domain data temporarily unavailable |
158159

159-
All exceptions expose `statusCode`, `errorCode`, and `getMessage()`. `RateLimitException` also has `retryAfter` (int or null).
160+
All exceptions expose `statusCode`, `errorCode`, and `getMessage()`. `RateLimitException` and `TemporarilyUnavailableException` also have `retryAfter` (int or null).
160161

161162
## Nullable Fields
162163

@@ -171,6 +172,14 @@ if ($domain->dates->expires !== null) {
171172
echo $domain->entities->registrant?->name;
172173
```
173174

175+
## Development
176+
177+
Set up pre-commit hooks (runs lint + tests before each commit):
178+
179+
```bash
180+
git config core.hooksPath .githooks
181+
```
182+
174183
## License
175184

176185
MIT — see [LICENSE](LICENSE).

0 commit comments

Comments
 (0)