diff --git a/.stickler.yml b/.stickler.yml new file mode 100644 index 00000000000..b68804448b2 --- /dev/null +++ b/.stickler.yml @@ -0,0 +1,10 @@ +--- +linters: + phpcs: + standard: 'dev/setup/codesniffer/ruleset.xml' + extensions: 'php' + tab_width: 4 + fixer: true + +fixers: + enable: true diff --git a/.travis.yml b/.travis.yml index 1521035578b..7c1552bb2a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -293,12 +293,12 @@ script: echo - | - echo "Checking coding style" + echo "Checking coding style (excluding Pull Requests builds)" # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . + if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e echo diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 0f508507491..5cf7e8cdb7a 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -646,7 +646,7 @@ class DiscountAbsolute $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc'; $sql.= ' WHERE rc.fk_facture IS NULL AND rc.fk_facture_source = '.$invoice->id; } - else if ($invoice->element == 'invoice_supplier') + elseif ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc';