Skip to content

Commit

Permalink
Add PHPStan rule level 10
Browse files Browse the repository at this point in the history
Added new rule level.
Removed special rendering of max rule level because "max" is individual option.
Reference:
- https://phpstan.org/user-guide/rule-levels
  • Loading branch information
KacerCZ committed Dec 3, 2024
1 parent 6b34b88 commit 2e32e97
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class AnalysisOptions {
private static final String PHPSTAN_CONFIGURATION = "phpstan.configuration"; // NOI18N
private static final String PHPSTAN_MEMORY_LIMIT = "phpstan.memory.limit"; // NOI18N
public static final int PHPSTAN_MIN_LEVEL = Integer.getInteger("nb.phpstan.min.level", 0); // NOI18N
public static final int PHPSTAN_MAX_LEVEL = Integer.getInteger("nb.phpstan.max.level", 9); // NOI18N
public static final int PHPSTAN_MAX_LEVEL = Integer.getInteger("nb.phpstan.max.level", 10); // NOI18N
// Psalm - PHP Static Analysis Tool
private static final String PSALM_PATH = "psalm.path"; // NOI18N
private static final String PSALM_LEVEL = "psalm.level"; // NOI18N
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.netbeans.modules.analysis.spi.Analyzer;
import org.netbeans.modules.php.analysis.commands.PHPStan;
import org.netbeans.modules.php.analysis.options.AnalysisOptions;
import org.netbeans.modules.php.analysis.ui.PHPStanLevelListCellRenderer;
import org.netbeans.modules.php.analysis.options.AnalysisOptionsValidator;
import org.netbeans.modules.php.analysis.options.ValidatorPHPStanParameter;
import org.netbeans.modules.php.analysis.ui.AnalysisDefaultDocumentListener;
Expand Down Expand Up @@ -121,7 +120,6 @@ private void initLevelComboBox() {
phpStanLevelComboBox.addItem(String.valueOf(i));
}
phpStanLevelComboBox.addItem(PHPStan.MAX_LEVEL);
phpStanLevelComboBox.setRenderer(new PHPStanLevelListCellRenderer(phpStanLevelComboBox.getRenderer()));
phpStanLevelComboBox.setSelectedItem(getValidLevel());
phpStanLevelComboBox.addItemListener(e -> setLevel());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.netbeans.modules.php.analysis.options.AnalysisOptions;
import org.netbeans.modules.php.analysis.options.AnalysisOptionsValidator;
import org.netbeans.modules.php.analysis.ui.AnalysisDefaultDocumentListener;
import org.netbeans.modules.php.analysis.ui.PHPStanLevelListCellRenderer;
import org.netbeans.modules.php.analysis.options.ValidatorPHPStanParameter;
import org.netbeans.modules.php.analysis.util.AnalysisUiUtils;
import org.netbeans.modules.php.api.validation.ValidationResult;
Expand Down Expand Up @@ -78,7 +77,6 @@ private void init() {
phpStanLevelComboBox.addItem(String.valueOf(i));
}
phpStanLevelComboBox.addItem(PHPStan.MAX_LEVEL);
phpStanLevelComboBox.setRenderer(new PHPStanLevelListCellRenderer(phpStanLevelComboBox.getRenderer()));
// add listener
DocumentListener defaultDocumentListener = new AnalysisDefaultDocumentListener(() -> fireChange());
phpStanTextField.getDocument().addDocumentListener(defaultDocumentListener);
Expand Down

0 comments on commit 2e32e97

Please sign in to comment.