Allow to validate the password_policy app

This commit is contained in:
Joas Schilling 2016-09-01 10:18:00 +02:00
parent 8c4e5a923a
commit 69b063f4c6
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 9 additions and 3 deletions

View File

@ -68,19 +68,25 @@ class CodeChecker extends BasicEmitter {
throw new \RuntimeException("No app with given id <$appId> known.");
}
return $this->analyseFolder($appPath);
return $this->analyseFolder($appId, $appPath);
}
/**
* @param string $appId
* @param string $folder
* @return array
*/
public function analyseFolder($folder) {
public function analyseFolder($appId, $folder) {
$errors = [];
$excludedDirectories = ['vendor', '3rdparty', '.git', 'l10n', 'tests', 'test'];
if ($appId === 'password_policy') {
$excludedDirectories[] = 'lists';
}
$excludes = array_map(function($item) use ($folder) {
return $folder . '/' . $item;
}, ['vendor', '3rdparty', '.git', 'l10n', 'tests', 'test']);
}, $excludedDirectories);
$iterator = new RecursiveDirectoryIterator($folder, RecursiveDirectoryIterator::SKIP_DOTS);
$iterator = new RecursiveCallbackFilterIterator($iterator, function($item) use ($folder, $excludes){