protected boolean modifyRulesetPhpStanInspectionSetting()

in src/com/jetbrains/php/tools/quality/phpstan/PhpStanComposerConfig.java [169:180]


  protected boolean modifyRulesetPhpStanInspectionSetting(@NotNull Project project, @NotNull Consumer<PhpStanGlobalInspection> consumer) {
    VirtualFile projectDir = project.getBaseDir();
    if (projectDir == null) return false;

    PsiDirectory file = ReadAction.compute(() -> PsiManager.getInstance(project).findDirectory(projectDir));
    if (file != null) {
      Key<PhpStanGlobalInspection> key = Key.create(PhpStanQualityToolType.INSTANCE.getInspectionId());
      InspectionProfileManager.getInstance(project).getCurrentProfile().modifyToolSettings(key, file, consumer);
      return true;
    }
    return false;
  }