diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2016-09-02 21:02:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 21:02:59 +0200 |
commit | 7e13db9952e12d1fa323300df8c93c3f8838127d (patch) | |
tree | 6665236437becfd226d9a9bc41e2cb8d4d40d168 /lib | |
parent | 3209a81e63156b68caa34356630323da4daa4a2f (diff) | |
parent | de96c5b17b72b0cd174dc1cfddc5ae3c1f94d81d (diff) | |
download | nextcloud-server-7e13db9952e12d1fa323300df8c93c3f8838127d.tar.gz nextcloud-server-7e13db9952e12d1fa323300df8c93c3f8838127d.zip |
Merge pull request #1225 from nextcloud/allow-to-validate-password-policy
Allow to validate the password_policy app
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/CodeChecker/CodeChecker.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/App/CodeChecker/CodeChecker.php b/lib/private/App/CodeChecker/CodeChecker.php index 569a452df73..5a3cc3122cb 100644 --- a/lib/private/App/CodeChecker/CodeChecker.php +++ b/lib/private/App/CodeChecker/CodeChecker.php @@ -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){ |