diff --git a/Hooks/syntax.sh b/Hooks/syntax.sh index 097ae09..1fc00f0 100644 --- a/Hooks/syntax.sh +++ b/Hooks/syntax.sh @@ -2,24 +2,24 @@ hasInvalidPhpSyntax() { # php lint - php -l "$1" - if [ $? -ne 0 ]; then + $(php -l "$1" > /dev/null) + if [[ $? != 0 ]]; then return 1 fi # phpcs - php -d memory_limit=4G ${rootpath}/vendor/bin/phpcs --standard="${rootpath}/Build/Config/phpcs.xml" --encoding=utf-8 -n -p "$1" - if [ $? -ne 0 ]; then + $(php -d memory_limit=4G ${rootpath}/vendor/bin/phpcs --standard="${rootpath}/Build/Config/phpcs.xml" --encoding=utf-8 -n -p "$1" > /dev/null) + if [[ $? != 0 ]]; then return 2 fi # phpmd - php -d memory_limit=4G ${rootpath}/vendor/bin/phpmd "$1" text ${rootpath}/Build/Config/phpmd.xml --exclude *tests* --minimumpriority 1 - if [ $? -ne 0 ]; then + $(php -d memory_limit=4G ${rootpath}/vendor/bin/phpmd "$1" text ${rootpath}/Build/Config/phpmd.xml --exclude *tests* --minimumpriority 1) + if [[ $? != 0 ]]; then return 3 fi - return 0; + return 0 } hasInvalidHtmlTemplateContent() {