public function detect(string
$zipFilePath): string
{ try { $archive = ZipUtils::
openZip($zipFilePath);
} catch (PluginExtractionException
$e) { throw PluginException::
noPluginFoundInZip($zipFilePath);
} try { return match (true
) { $this->
isPlugin($archive) => PluginManagementService::PLUGIN,
$this->
isApp($archive) => PluginManagementService::APP,
default =>
throw PluginException::
noPluginFoundInZip($zipFilePath) };
} finally { $archive->
close();
} } public function isPlugin(\ZipArchive
$archive): bool
{ $entry =
$archive->
statIndex(0
);
if ($entry === false
) {