Added PHPStan on level 0 for lib directory
This commit is contained in:
@ -42,6 +42,26 @@ jobs:
|
|||||||
root: /home/circleci/mailpoet
|
root: /home/circleci/mailpoet
|
||||||
paths:
|
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:
|
php5_unit:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
docker:
|
docker:
|
||||||
@ -257,6 +277,9 @@ workflows:
|
|||||||
build_and_test:
|
build_and_test:
|
||||||
jobs:
|
jobs:
|
||||||
- build_and_code_qa
|
- build_and_code_qa
|
||||||
|
- static_analysis:
|
||||||
|
requires:
|
||||||
|
- build_and_code_qa
|
||||||
- php5_unit:
|
- php5_unit:
|
||||||
requires:
|
requires:
|
||||||
- build_and_code_qa
|
- build_and_code_qa
|
||||||
|
6
tasks/phpstan/bootstrap.php
Normal file
6
tasks/phpstan/bootstrap.php
Normal 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';
|
11
tasks/phpstan/phpstan.neon
Normal file
11
tasks/phpstan/phpstan.neon
Normal 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
|
Reference in New Issue
Block a user