Skip to content

Commit e6b1aef

Browse files
committed
Add option to set phpVersion to 80100 on PHP 7.4
Fixes #272
1 parent 900d859 commit e6b1aef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/Command/CheckCommand.php

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ protected function configure(): void
3434
->addOption('deprecations', 'd', InputOption::VALUE_NONE, 'Check for deprecations')
3535
->addOption('analysis', 'a', InputOption::VALUE_NONE, 'Check code analysis')
3636
->addOption('style', 's', InputOption::VALUE_NONE, 'Check code style')
37+
->addOption('php8', null, InputOption::VALUE_NONE, 'Set PHPStan phpVersion for 8.1 (Drupal 10 requirement)')
3738
->addOption('memory-limit', null, InputOption::VALUE_OPTIONAL, 'Memory limit for analysis')
3839
->addOption('exclude-dir', 'e', InputOption::VALUE_OPTIONAL, 'Directories to exclude. Separate multiple directories with a comma, no spaces.')
3940
->addOption(
@@ -144,6 +145,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
144145
]
145146
];
146147

148+
if ($input->getOption('php8')) {
149+
$configuration_data['parameters']['phpVersion'] = 80100;
150+
}
151+
147152
if (!empty($this->excludeDirectory)) {
148153
// There may be more than one path passed in, comma separated.
149154
$excluded_directories = explode(',', $this->excludeDirectory);

0 commit comments

Comments
 (0)