Added PHPStan on level 0 for lib directory

This commit is contained in:
Jan Jakeš
2018-11-14 16:44:44 +01:00
committed by Pavel Dohnal
parent a393ad5b61
commit 0a12d64cbf
3 changed files with 40 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,6 @@
<?php
define('ABSPATH', getenv('WP_ROOT') . '/');
require_once ABSPATH . 'wp-load.php';
require_once ABSPATH . 'wp-admin/includes/admin.php';

View File

@ -0,0 +1,11 @@
parameters:
tmpDir: temp/phpstan
bootstrap: tasks/phpstan/bootstrap.php
ignoreErrors:
- '#Access to an undefined property#' # current code suffers from this, it should be fixed & this line removed
- '#Static call to instance method MailPoet\\Models\\Model::#'
- '#Access to an undefined static property MailPoet\\Models\\Model::#'
- '#Function members_register_.+ not found#'
excludes_analyse:
- lib/Dependencies
- lib/DI/CachedContainer.php