Skip to content
PHP Ecosystem
Explore

BunAuditParser

API reference › Foxy › Audit › Parser › BunAuditParser

Parses the bun audit --json report, which is the npm registry’s bulk advisories document.

MethodDescriptionDefined by
parse()Parses a bulk advisories JSON object into normalized findings.AbstractBulkAdvisoryParser
assertNotErrorDocument() protected finalRejects a JSON document that represents a package manager error.AbstractAuditParser
assertOutputSize() protected finalRejects audit output that exceeds the parser’s size limit.AbstractAuditParser
decodeObject() protected finalDecodes an audit JSON object after validating its size and shape.AbstractAuditParser
getAdvisoryId() protected finalSelects a GHSA identifier from the candidate or URL, falling back to the source identifier.AbstractAuditParser
getBoolean() protected finalReturns a required boolean field.AbstractAuditParser
getCves() protected finalReturns validated, normalized CVE identifiers.AbstractAuditParser
getGhsaId() protected finalExtracts and normalizes a GHSA identifier from a value or URL.AbstractAuditParser
getManagerName() protectedReturns the Bun manager name.BunAuditParser
getNonNegativeInteger() protected finalReturns a required non-negative integer field.AbstractAuditParser
getObject() protected finalConverts a decoded JSON object into its property map.AbstractAuditParser
getOptionalString() protected finalReturns a sanitized optional string field, or null when absent or empty.AbstractAuditParser
getSeverity() protected finalReturns a supported normalized severity value.AbstractAuditParser
getSeverityCount() protected finalReturns the sum of severity counts and optionally validates the reported total.AbstractAuditParser
getSourceId() protected finalReturns a non-empty source identifier from a string or integer value.AbstractAuditParser
getString() protected finalReturns a required sanitized string field.AbstractAuditParser
getStringList() protected finalReturns a normalized list containing only strings.AbstractAuditParser
malformed() protected finalCreates a package-manager-specific malformed-output exception.AbstractAuditParser
sanitizeString() protected finalReplaces control characters and trims surrounding whitespace.AbstractAuditParser
uniqueStrings() protected finalReturns unique strings in deterministic order.AbstractAuditParser
protected function getManagerName(): string

Returns the Bun manager name.

Returns

string