Skip to content

Commit

Permalink
Add rudimentary PHP syntax checking (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed May 7, 2018
1 parent 2cc2fd8 commit c113ff3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: php
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
matrix:
allow_failures:
- php: hhvm
script:
- bin/check-syntax.sh
15 changes: 15 additions & 0 deletions bin/check-syntax.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

PHP='/usr/bin/env php'
RETURN=0

# check PHP files
for FILE in `find config-templates hooks lib templates www -name "*.php"`; do
$PHP -l $FILE > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Syntax check failed for ${FILE}"
RETURN=`expr ${RETURN} + 1`
fi
done

exit $RETURN

0 comments on commit c113ff3

Please sign in to comment.