Add isset checks for mobile margin state variables #1033
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Syntax Check | |
on: | |
push: | |
paths: | |
- '**/*.php' | |
- '**/*.tpl' | |
- '!vendor/**' | |
pull_request: | |
paths: | |
- '**/*.php' | |
- '**/*.tpl' | |
- '!vendor/**' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: Install Smarty | |
run: | | |
# Install Smarty globally if possible; ignore failures due to network restrictions | |
composer global require smarty/smarty:^3 || true | |
- name: PHP lint | |
run: | | |
# Ignore vendor directory to avoid linting third-party code | |
find . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n1 -I{} php -l {} | |
- name: Smarty lint | |
run: | | |
SMARTY_AUTOLOAD="$(composer global config home 2>/dev/null)/vendor/autoload.php" | |
files=$(find . -path ./vendor -prune -o -name '*.tpl' -print) | |
if [ -f "$SMARTY_AUTOLOAD" ] && [ -n "$files" ]; then | |
for f in $files; do | |
php -r "require '$SMARTY_AUTOLOAD'; \$smarty=new Smarty(); \$smarty->compileCheck=true; try{ \$smarty->fetch('$f'); } catch(Exception \$e){ echo \$e->getMessage(); exit(1); }" | |
done | |
else | |
echo 'Smarty not installed; skipping template lint.' | |
fi |