-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
instal php stan integration for TCMN
- Loading branch information
Showing
5 changed files
with
160 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'PHPStan Tests' | ||
on: | ||
pull_request: | ||
paths: | ||
- '.github/**/*' | ||
- '*.php' | ||
- 'src/**.php' | ||
jobs: | ||
phpstan: | ||
strategy: | ||
matrix: | ||
phpVersion: [ | ||
"7.4", | ||
# ---------------------------------------- | ||
# Disabled until we get all of 7.4 passing | ||
# "8.0", | ||
# "8.1", | ||
# "8.2", | ||
# "8.3", | ||
# ---------------------------------------- | ||
] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
# ------------------------------------------------------------------------------ | ||
# Set up PHP and run phpstan | ||
# ------------------------------------------------------------------------------ | ||
- name: Configure PHP environment to run phpstan | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.phpVersion }} | ||
# ------------------------------------------------------------------------------ | ||
# Override composer php version | ||
# ------------------------------------------------------------------------------ | ||
- name: Set php version ${{ matrix.phpVersion }} in composer | ||
run: composer config platform.php ${{ matrix.phpVersion }} | ||
# ------------------------------------------------------------------------------ | ||
# Install dependencies - ignoring php requirements | ||
# ------------------------------------------------------------------------------ | ||
- name: Install dependencies | ||
run: composer i --ignore-platform-req=php+ | ||
# ------------------------------------------------------------------------------ | ||
# Run phpstan | ||
# ------------------------------------------------------------------------------ | ||
- name: Run phpstan | ||
run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist --memory-limit=1024M --error-format=table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Configuration for PHPStan | ||
# https://phpstan.org/config-reference | ||
|
||
includes: | ||
# @see https://github.com/phpstan/phpstan-src/blob/master/conf/bleedingEdge.neon | ||
- phar://phpstan.phar/conf/bleedingEdge.neon | ||
# Include this extension | ||
- vendor/szepeviktor/phpstan-wordpress/extension.neon | ||
|
||
parameters: | ||
parallel: | ||
jobSize: 10 | ||
maximumNumberOfProcesses: 32 | ||
minimumNumberOfJobsPerProcess: 2 | ||
level: 5 | ||
inferPrivatePropertyTypeFromConstructor: true | ||
reportUnmatchedIgnoredErrors: false | ||
checkGenericClassInNonGenericObjectType: false | ||
treatPhpDocTypesAsCertain: false | ||
|
||
# Paths to be analyzed. | ||
paths: | ||
- %currentWorkingDirectory%/src | ||
|
||
ignoreErrors: | ||
# Uses func_get_args() | ||
- '#^Function add_query_arg invoked with [123] parameters?, 0 required\.$#' | ||
# Uses func_get_args() | ||
- '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' | ||
- '#^Constant WP_CONTENT_DIR not found\.$#' | ||
- '#^Constant WP_CONTENT_URL not found\.$#' | ||
- '#^Constant WPMU_PLUGIN_URL not found\.$#' | ||
- '#^Constant WP_PLUGIN_DIR not found\.$#' | ||
- '#^Constant WP_PLUGIN_URL not found\.$#' |