Skip to content
Snippets Groups Projects
Commit c55da1fc authored by Joas Schilling's avatar Joas Schilling
Browse files

Add a warning to the app:check-code if the version is missing

parent 83855c07
No related branches found
No related tags found
No related merge requests found
...@@ -131,6 +131,10 @@ class CheckCode extends Command { ...@@ -131,6 +131,10 @@ class CheckCode extends Command {
} }
}); });
$infoChecker->listen('InfoChecker', 'missingRequirement', function($minMax) use ($output) {
$output->writeln("<comment>ownCloud $minMax version requirement missing (will be an error in ownCloud 11 and later)</comment>");
});
$infoChecker->listen('InfoChecker', 'duplicateRequirement', function($minMax) use ($output) { $infoChecker->listen('InfoChecker', 'duplicateRequirement', function($minMax) use ($output) {
$output->writeln("<error>Duplicate $minMax ownCloud version requirement found</error>"); $output->writeln("<error>Duplicate $minMax ownCloud version requirement found</error>");
}); });
......
...@@ -83,13 +83,18 @@ class InfoChecker extends BasicEmitter { ...@@ -83,13 +83,18 @@ class InfoChecker extends BasicEmitter {
'type' => 'duplicateRequirement', 'type' => 'duplicateRequirement',
'field' => 'min', 'field' => 'min',
]; ];
} else if (!isset($info['dependencies']['owncloud']['@attributes']['min-version'])) {
$this->emit('InfoChecker', 'missingRequirement', ['min']);
} }
if (isset($info['dependencies']['owncloud']['@attributes']['max-version']) && $info['requiremax']) { if (isset($info['dependencies']['owncloud']['@attributes']['max-version']) && $info['requiremax']) {
$this->emit('InfoChecker', 'duplicateRequirement', ['max']); $this->emit('InfoChecker', 'duplicateRequirement', ['max']);
$errors[] = [ $errors[] = [
'type' => 'duplicateRequirement', 'type' => 'duplicateRequirement',
'field' => 'max', 'field' => 'max',
]; ];
} else if (!isset($info['dependencies']['owncloud']['@attributes']['max-version'])) {
$this->emit('InfoChecker', 'missingRequirement', ['max']);
} }
foreach ($info as $key => $value) { foreach ($info as $key => $value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment