WI-63901 increased PHPStan rule level limit
Level 10 appeared in PHPStan 2.0: https://phpstan.org/user-guide/rule-levels
Maybe we could check the PHPStan-version to set the correct max-level? Otherwise we give it to the user to select the correct level.
I am not familiar with plugin development so I don't know if there can be project specific UI-settings.
You can put an arbitrary integer, and PHPStan will automatically understand it as the maximum number inside the range of levels if it is higher than the maximum level.
I would only limit the field to a range of positive integers, and defer the behavior to PHPStan itself.
I tried letting PHPStan set the highest level automatically in PHPStan 2.0.2 and 1.12.11 with composer. If I use a non existent level, PHPStan throws an error:
vendor/bin/phpstan analyse --level=12
Note: Using configuration file /var/www/html/www/phpstan.dist.neon.
Level config file phar:///var/www/html/www/vendor/phpstan/phpstan/phpstan.phar/conf/config.level12.neon was not found.
If I use the key max, as documented, I use the max level.
But I agree with you about setting the minimum level to 0 and no max. If the user sets it higher than the max-level and PHPStan throws an error, the plugin should throw an error in the IDE notifications. Also we never have to update the spinner again.
Also my Intellij-Licence expired and I will not buy a new one. Maybe someone should compile the Plugin and test it.
I can't test if Integer.MAX_VALUE would work instead of 99 and I am not experienced with Java at all, so I can't tell if it would work with that. But I committed 99 for now.