diff --git a/src/Workbench/Workbench.php b/src/Workbench/Workbench.php index e0c1e577..bc41bb15 100644 --- a/src/Workbench/Workbench.php +++ b/src/Workbench/Workbench.php @@ -319,12 +319,16 @@ public static function applicationUserModel(): ?string /** * Detect namespace by type. + * + * @param string $type + * @param bool $force + * @return string|null */ - public static function detectNamespace(string $type): ?string + public static function detectNamespace(string $type, bool $force = false): ?string { $type = trim($type, '/'); - if (! isset(static::$cachedNamespaces[$type])) { + if (! isset(static::$cachedNamespaces[$type]) || $force === true) { static::$cachedNamespaces[$type] = null; /** @var array{'autoload-dev': array{'psr-4': array|string>}} $composer */