Skip to content
PHP Ecosystem
Explore

NativeAuditParser

API reference › Foxy › Audit › Parser › NativeAuditParser

Parses the bulk advisories document that the native manager fetches from the configured npm registry.

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 native manager name.NativeAuditParser
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 native manager name.

Returns

string