Skip to content

Commit

Permalink
Add option to set phpVersion to 80100 on PHP 7.4
Browse files Browse the repository at this point in the history
Fixes #272
  • Loading branch information
mglaman committed Apr 29, 2022
1 parent 900d859 commit e6b1aef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Command/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected function configure(): void
->addOption('deprecations', 'd', InputOption::VALUE_NONE, 'Check for deprecations')
->addOption('analysis', 'a', InputOption::VALUE_NONE, 'Check code analysis')
->addOption('style', 's', InputOption::VALUE_NONE, 'Check code style')
->addOption('php8', null, InputOption::VALUE_NONE, 'Set PHPStan phpVersion for 8.1 (Drupal 10 requirement)')
->addOption('memory-limit', null, InputOption::VALUE_OPTIONAL, 'Memory limit for analysis')
->addOption('exclude-dir', 'e', InputOption::VALUE_OPTIONAL, 'Directories to exclude. Separate multiple directories with a comma, no spaces.')
->addOption(
Expand Down Expand Up @@ -144,6 +145,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
]
];

if ($input->getOption('php8')) {
$configuration_data['parameters']['phpVersion'] = 80100;
}

if (!empty($this->excludeDirectory)) {
// There may be more than one path passed in, comma separated.
$excluded_directories = explode(',', $this->excludeDirectory);
Expand Down

0 comments on commit e6b1aef

Please sign in to comment.