open($zipFilePath, ZipArchive::RDONLY); if ($openResp !== true) { throw new InvalidPluginException( "Failed open zip archive with following code: " . $openResp ); } $jsonFileContent = $zip->getFromName('composer.json'); if ($jsonFileContent === false) { throw new PluginComposerFileNotFoundException(); } return new Context($jsonFileContent); } }