system/Autoloader/FileLocator.php
protected function getNamespaces(string $prefix = null)
	{
		if ($prefix)
		{
			$path = $this->autoloader->getNamespace($prefix);

			return isset($path[0])
				? rtrim($path[0], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR
				: '';
		}

		$namespaces = [];

		foreach ($this->autoloader->getNamespace() as $prefix => $paths)
		{
			foreach ($paths as $path)
			{
				$namespaces[] = [
					'prefix' => $prefix,
					'path'   => rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR,
				];
			}
		}

		return $namespaces;
	}
protected function getNamespaces(string $prefix = null)
	{
		if ($prefix)
		{
			$path = $this->autoloader->getNamespace($prefix);

			return isset($path[0])
				? rtrim($path[0], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR
				: '';
		}

		$namespaces = [];

		foreach ($this->autoloader->getNamespace() as $prefix => $paths)
		{
			foreach ($paths as $path)
			{
				$namespaces[] = [
					'prefix' => $prefix,
					'path'   => rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR,
				];
			}
		}

		return $namespaces;
	}
@param string|null $prefix

@return array|string