From fde2102d20167b7485977f82331a133cd6745cd6 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Mon, 7 Aug 2023 09:41:26 +0330 Subject: [PATCH] Adds further improvements. Signed-off-by: Faraz Samapoor Signed-off-by: Faraz Samapoor --- tests/apps.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/apps.php b/tests/apps.php index f8bb86ff57c7b..cd173fff5d5e9 100644 --- a/tests/apps.php +++ b/tests/apps.php @@ -6,34 +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)) { return; } - + while ($name = readdir($dh)) { if ($name[0] === '.') { continue; } - + $file = $path . '/' . $name; if (is_dir($file)) { loadDirectory($file); - } elseif (substr($name, -4, 4) === '.php') { + } 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)) {