Drupal Core uses PHPStan to help introduce strict and informative types to its codebase. Its configuration file can be found in core/phpstan.neon.dist. Drupal Core uses the PHPStan extension installer to automatically load installed PHPStan libraries into its configuration. The following extensions are used at the time of writing:
Performing static analysis of Drupal code with PHPStan
PHPStan is a static analysis tool that allows you to find bugs in your codebase without running the code. The phpstan-drupal extension for PHPStan makes it possible to perform static analysis of Drupal code.