From 0ac1c3a36b75123d2f8face324c1a1a646fa9b79 Mon Sep 17 00:00:00 2001 From: Matt Glaman Date: Tue, 10 Nov 2026 16:00:59 -0600 Subject: [PATCH] Document that manual installs need rules.neon for loadInclude() files LoadIncludes and ModuleLoadInclude load the files that loadInclude() and module_load_include() include. A config with only extension.neon reports functions from those files as not found. Fixes #741. Co-Authored-By: Claude Opus 5.5 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bf2d5256..1f2147db 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,18 @@ When you are using [`phpstan/extension-installer`](https://github.com/phpstan/ex
Manual installation -If you don't want to use `phpstan/extension-installer`, include `extension.neon` in your project's PHPStan config: +If you don't want to use `phpstan/extension-installer`, include both files in your project's PHPStan config: -``` +```neon includes: - vendor/mglaman/phpstan-drupal/extension.neon + - vendor/mglaman/phpstan-drupal/rules.neon ``` -To include Drupal specific analysis rules, include this file: +`extension.neon` adds Drupal's types and services. `rules.neon` adds the Drupal rules. Two of those rules also load files for the rest of the analysis: `LoadIncludes` loads the file a `ModuleHandlerInterface::loadInclude()` call includes, and `ModuleLoadInclude` does the same for `module_load_include()`. Without `rules.neon`, functions from those files are reported as not found: ``` -includes: - - vendor/mglaman/phpstan-drupal/rules.neon +Function locale_translation_flush_projects not found. ```