Last active
December 3, 2024 14:23
-
-
Save mglaman/240f742a5aea69cdcc5a209391be8c5a to your computer and use it in GitHub Desktop.
PHPStan configuration for Drupal 7 – https://youtu.be/9HYwq5jq4Sk
This file contains hidden or 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
parameters: | |
level: 0 | |
excludePaths: | |
- '*.api.php' | |
- '*.database.php' | |
scanFiles: | |
- web/authorize.php | |
- web/cron.php | |
- web/index.php | |
- web/update.php | |
- web/xmlrpc.php | |
# A quirk with functions that return values by reference &batch_get | |
# and &views_get_page_view. The problem resolves if the file is specifically scanned. | |
- web/includes/form.inc | |
# - web/sites/all/modules/contrib/views/views.module | |
scanDirectories: | |
- web/includes | |
- web/misc | |
- web/modules | |
- web/profiles | |
- web/themes | |
- web/sites/all | |
fileExtensions: | |
- module | |
- theme | |
- inc | |
- install | |
- profile | |
- engine | |
- test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this config file! Here are a few notes from a n00b:
excludePaths
instead ofexcludes_analyse
.phpVersion: 80100
.phpstan
from there, or add the--configuration
(short form-c
) option. Look for "Note: Using configuration file ..." at the top of the command's output.I ran into the last point when using DDev: by default,
ddev ssh
changes to theweb/
directory.References: