Browse Source

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

tags/v9.0beta1
Joas Schilling 8 years ago
parent
commit
c55da1fc8d
2 changed files with 9 additions and 0 deletions
  1. 4
    0
      core/command/app/checkcode.php
  2. 5
    0
      lib/private/app/codechecker/infochecker.php

+ 4
- 0
core/command/app/checkcode.php View File

@@ -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) {
$output->writeln("<error>Duplicate $minMax ownCloud version requirement found</error>");
});

+ 5
- 0
lib/private/app/codechecker/infochecker.php View File

@@ -83,13 +83,18 @@ class InfoChecker extends BasicEmitter {
'type' => 'duplicateRequirement',
'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']) {
$this->emit('InfoChecker', 'duplicateRequirement', ['max']);
$errors[] = [
'type' => 'duplicateRequirement',
'field' => 'max',
];
} else if (!isset($info['dependencies']['owncloud']['@attributes']['max-version'])) {
$this->emit('InfoChecker', 'missingRequirement', ['max']);
}

foreach ($info as $key => $value) {

Loading…
Cancel
Save