#!/usr/bin/env bash
set -euo pipefail

if ! command -v php >/dev/null 2>&1; then
  echo "ERROR: PHP binary not found."
  exit 1
fi

find laravel-overlay -type f -name '*.php' -print0 | while IFS= read -r -d '' file; do
  php -l "$file" >/dev/null
  echo "OK  $file"
done

echo "All PHP files passed syntax checks."
