From 227ca8a0352a398ff7f5c1abd9e18cccd6997358 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 14 Dec 2017 22:42:05 +0100 Subject: [PATCH] TASK: Add php linting To make sure there are no syntax errors in files. --- .travis.yml | 14 ++++++++++++++ composer.json | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4b49b98 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: php + +php: + - 5.6 + - 7.0 + - 7.1 + - 7.2 + +install: + - composer install + +script: + - composer lint + - composer cgl diff --git a/composer.json b/composer.json index 02de3f6..725fa2b 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,10 @@ }, "scripts": { "lint": [ + "! find Classes -type f -name \"*.php\" -exec php -d error_reporting=32767 -l {} \\; 2>&1 >&- | grep \"^\"", + "! find Tests -type f -name \"*.php\" -exec php -d error_reporting=32767 -l {} \\; 2>&1 >&- | grep \"^\"" + ], + "cgl": [ "./vendor/bin/phpcs" ], "post-install-cmd": [