install our default dependencies with myrepos and run doc/php_syntax_check.sh to (checks and reports all files, not just first failure)

This commit is contained in:
Ralf Becker 2016-05-30 18:19:48 +02:00
parent 38f1c2b76b
commit 1eed5073b2
2 changed files with 19 additions and 1 deletions

View File

@ -26,9 +26,12 @@ before_script:
# - mysql -e 'create database egroupware'
- rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
#- composer update --prefer-source $LOWEST_DEPS
- aptitude install myrepos
- mr --trust-all --stats up
script:
- find . -name "*.php" | xargs -n1 php -l
#- find . -name "*.php" | xargs -n1 php -l
./doc/php_syntax_check.sh
#- ./vendor/bin/sabre-cs-fixer fix . --dry-run --diff
cache:

15
doc/php_syntax_check.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
################################################################################
### Tool to check for PHP Syntax errors
### Usage: doc/php_syntax_check [file or directory, defaults to whole egrouware]
### Will output all PHP Fatal, Parse erros and also Deprecated incl. filename
### Exit-status: 0 on no error, but maybe Deprecated warnings, 1 on error
################################################################################
cd `dirname $0`
cd ..
find ${@-.} -name '*.php' -exec php -l {} \; 2>&1 | \
#grep -v 'No syntax errors detected in' | \
grep '^PHP' | \
perl -pe 'END { exit $status } $status=1 if /^PHP (Fatal|Parse error)/;'