From 0a12d64cbf0ae35a76e2bd29b2a50486270a27dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jakes=CC=8C?= Date: Wed, 14 Nov 2018 16:44:44 +0100 Subject: [PATCH] Added PHPStan on level 0 for lib directory --- .circleci/config.yml | 23 +++++++++++++++++++++++ tasks/phpstan/bootstrap.php | 6 ++++++ tasks/phpstan/phpstan.neon | 11 +++++++++++ 3 files changed, 40 insertions(+) create mode 100644 tasks/phpstan/bootstrap.php create mode 100644 tasks/phpstan/phpstan.neon diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a49ca5780..762cfb0dc1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,6 +42,26 @@ jobs: root: /home/circleci/mailpoet paths: - . + static_analysis: + working_directory: /home/circleci/mailpoet + docker: + - image: mailpoet/wordpress:7.1_20181009.1 + - image: circleci/mysql:5.7 + environment: + TZ: /usr/share/zoneinfo/Etc/UTC + steps: + - attach_workspace: + at: /home/circleci/mailpoet + - run: + name: "Set up environment" + command: | + ./composer.phar install --no-dev --no-scripts + source ./.circleci/setup.bash && setup php7 + wget https://github.com/phpstan/phpstan/releases/download/0.10.5/phpstan.phar + - run: + name: "Static analysis" + command: | + WP_ROOT="/home/circleci/mailpoet/wordpress" php -d memory_limit=2G phpstan.phar analyse -c tasks/phpstan/phpstan.neon -l 0 lib/ php5_unit: working_directory: /home/circleci/mailpoet docker: @@ -257,6 +277,9 @@ workflows: build_and_test: jobs: - build_and_code_qa + - static_analysis: + requires: + - build_and_code_qa - php5_unit: requires: - build_and_code_qa diff --git a/tasks/phpstan/bootstrap.php b/tasks/phpstan/bootstrap.php new file mode 100644 index 0000000000..ea398de575 --- /dev/null +++ b/tasks/phpstan/bootstrap.php @@ -0,0 +1,6 @@ +