diff --git a/system/Publisher/Publisher.php b/system/Publisher/Publisher.php index 5cd392d921a8..01a3c62db657 100644 --- a/system/Publisher/Publisher.php +++ b/system/Publisher/Publisher.php @@ -111,9 +111,9 @@ final public static function discover(string $directory = 'Publishers'): array // Loop over each file checking to see if it is a Publisher foreach (array_unique($files) as $file) { - $className = $locator->findQualifiedNameFromPath($file); + $className = $locator->getClassname($file); - if (is_string($className) && class_exists($className) && is_a($className, self::class, true)) { + if ($className !== '' && class_exists($className) && is_a($className, self::class, true)) { self::$discovered[$directory][] = new $className(); } }