aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2023-09-27 08:32:29 +0200
committerGitHub <noreply@github.com>2023-09-27 08:32:29 +0200
commit0a20b5de7456b0b297868a79fe4cdd1bedeec072 (patch)
tree6f9eddca2ac98d06b3e6c15bfbbd87615caf07f4
parent912b18b1fc9fd90bfc78f942cd2043a5a0145e69 (diff)
parentc322224650f7095417363ca192c051ccb02a7639 (diff)
downloadnextcloud-server-0a20b5de7456b0b297868a79fe4cdd1bedeec072.tar.gz
nextcloud-server-0a20b5de7456b0b297868a79fe4cdd1bedeec072.zip
Merge pull request #36742 from fsamapoor/patch-1
Refactors tests/app.php to improve code readability.
-rw-r--r--tests/apps.php30
1 files changed, 18 insertions, 12 deletions
diff --git a/tests/apps.php b/tests/apps.php
index 27bd428d949..cd173fff5d5 100644
--- a/tests/apps.php
+++ b/tests/apps.php
@@ -6,28 +6,34 @@
* See the COPYING-README file.
*/
-function loadDirectory($path) {
+function loadDirectory($path): void {
if (strpos($path, 'integration')) {
return;
}
+
if (strpos($path, 'Integration')) {
return;
}
- if ($dh = opendir($path)) {
- while ($name = readdir($dh)) {
- if ($name[0] !== '.') {
- $file = $path . '/' . $name;
- if (is_dir($file)) {
- loadDirectory($file);
- } elseif (substr($name, -4, 4) === '.php') {
- require_once $file;
- }
- }
+
+ if (! $dh = opendir($path)) {
+ return;
+ }
+
+ while ($name = readdir($dh)) {
+ if ($name[0] === '.') {
+ continue;
+ }
+
+ $file = $path . '/' . $name;
+ if (is_dir($file)) {
+ loadDirectory($file);
+ } elseif (str_ends_with($name, '.php')) {
+ require_once $file;
}
}
}
-function getSubclasses($parentClassName) {
+function getSubclasses($parentClassName): array {
$classes = [];
foreach (get_declared_classes() as $className) {
if (is_subclass_of($className, $parentClassName)) {