1

我有这个结构:

apps
 - project_1
   - app
   - vendor
 - project_2
   - app
   - vendor
 - project_3
   - app
   - vendor
phpstan.neon
composer.json

我无法在“应用程序”的根目录下运行 PHPStan 来分析我的项目 1、2、3 等……我找不到类错误。

所以我在我的phpstan.neon上做了这个结构

parameters:
    level: 1
    paths:
        - apps/project_1/app
        - apps/project_1/config
        - apps/project_1/lambda
        - apps/project_1/tests
    bootstrapFiles:
        - apps/project_1/vendor/autoload.php

它正在工作,但我无法为我的不同项目添加多个引导文件。

这不起作用:

parameters:
    level: 1
    paths:
        - apps/project_1/app
        - apps/project_1/config
        - apps/project_1/lambda
        - apps/project_1/tests
        - apps/project_2/app
    bootstrapFiles:
        - apps/project_1/vendor/autoload.php
        - apps/project_2/vendor/autoload.php

我需要这样的东西:

parameters:
    level: 1
    paths:
        - apps/project_1/app
        - apps/project_1/config
        - apps/project_1/lambda
        - apps/project_1/tests
    bootstrapFiles:
        - apps/project_1/vendor/autoload.php
    paths:
        - apps/project_2/app
    bootstrapFiles:     
        - apps/project_2/vendor/autoload.php

可以为特定路径指定 bootstrapFiles 吗?

谢谢 :) !

4

1 回答 1

1

首选的方法是phpstan.neon对每个项目进行单独的分析,以便可以完全单独地对其进行分析。

要一次分析它们,例如创建一个Makefile脚本,让您可以同时在所有这些上单独运行 PHPStan。

于 2021-10-18T16:44:52.380 回答