{"record":{"id":"8ab5094bd87a70f5","repo":"phar-io/manifest","slug":"unsupported-type-s","errorCode":null,"errorMessage":"Unsupported type %s","messagePattern":"Unsupported type (.+?)","errorType":"exception","errorClass":"ManifestDocumentMapperException","httpStatus":null,"severity":"error","filePath":"src/ManifestDocumentMapper.php","lineNumber":51,"sourceCode":"                $requirements,\n                $bundledComponents\n            );\n        } catch (Throwable $e) {\n            throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e);\n        }\n    }\n\n    private function mapType(ContainsElement $contains): Type {\n        switch ($contains->getType()) {\n            case 'application':\n                return Type::application();\n            case 'library':\n                return Type::library();\n            case 'extension':\n                return $this->mapExtension($contains->getExtensionElement());\n        }\n\n        throw new ManifestDocumentMapperException(\n            sprintf('Unsupported type %s', $contains->getType())\n        );\n    }\n\n    private function mapCopyright(CopyrightElement $copyright): CopyrightInformation {\n        $authors = new AuthorCollection();\n\n        foreach ($copyright->getAuthorElements() as $authorElement) {\n            $authors->add(\n                new Author(\n                    $authorElement->getName(),\n                    $authorElement->hasEMail() ? new Email($authorElement->getEmail()) : null\n                )\n            );\n        }\n\n        $licenseElement = $copyright->getLicenseElement();\n        $license        = new License(","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/phar-io/manifest/blob/c581d4941e196459bf76c945a8ca922963a66708/src/ManifestDocumentMapper.php#L33-L69","documentation":"mapType() only accepts 'application', 'library', and 'extension' as the <contains type=\"...\"> value; anything else throws ManifestDocumentMapperException with the unsupported type name. The manifest type attribute is effectively a closed enum.","triggerScenarios":"A manifest.xml containing <contains type=\"plugin\">, an empty type attribute, or a capitalized/mispelled type like 'Application' or 'libary'.","commonSituations":"Copying a manifest template and editing the type to a project-specific value; typos when hand-editing; older manifests written for a different schema version.","solutions":["Set the type attribute to one of exactly: application, library, or extension","Check for typos and casing — the comparison is case-sensitive lowercase","If representing a custom component kind, use 'library' or 'extension' instead"],"exampleFix":"// before\n<contains type=\"phar-plugin\" name=\"acme/tool\" version=\"1.0.0\" />\n// after\n<contains type=\"application\" name=\"acme/tool\" version=\"1.0.0\" />","handlingStrategy":"validation","validationCode":"$allowed = ['application','library','extension'];\nif (!in_array($type, $allowed, true)) {\n    throw new InvalidArgumentException(\"type must be one of: \" . implode(', ', $allowed));\n}","typeGuard":"function isSupportedManifestType(string $type): bool {\n    return in_array($type, ['application','library','extension'], true);\n}","tryCatchPattern":"try {\n    $manifest = ManifestLoader::fromFile($path);\n} catch (ManifestLoaderException $e) {\n    if (str_contains($e->getPrevious()?->getMessage() ?? '', 'Unsupported type')) {\n        // fix the <contains type> attribute\n    }\n}","preventionTips":["Copy type values from the official schema, never invent them","Add a schema (XSD) validation step in your build pipeline","Use lowercase exact spelling for the type attribute"],"tags":["php","manifest","enum","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"c581d4941e196459bf76c945a8ca922963a66708","analyzedAt":"2026-09-14T11:08:47.165Z","contentChangedAt":"2026-09-14T11:08:47.165Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}