# AuditFinding

> Represents one normalized frontend dependency security advisory.

[API reference](/docs/api/index.md) › [Foxy](/docs/extensions/foxy/reference/index.md) › [Audit](/docs/extensions/foxy/reference/audit/index.md) › AuditFinding

| final readonly class | `Foxy\Audit\AuditFinding` |
| --- | --- |
| Source | [`src/Audit/AuditFinding.php`](https://github.com/php-forge/foxy/blob/main/src/Audit/AuditFinding.php#L10) |

Represents one normalized frontend dependency security advisory.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-advisoryId"></span>`$advisoryId` readonly constructor | `string` | Preferred advisory identifier, such as a GHSA identifier. | `AuditFinding` |
| <span id="property-affectedVersions"></span>`$affectedVersions` readonly constructor | `list<string>` | Installed versions affected by the advisory. Default: `[]`. | `AuditFinding` |
| <span id="property-cves"></span>`$cves` readonly constructor | `list<string>` | Associated CVE identifiers. Default: `[]`. | `AuditFinding` |
| <span id="property-cveStatus"></span>`$cveStatus` readonly constructor | [`CveStatus`](/docs/extensions/foxy/reference/audit/cvestatus/index.md) | Status of CVE resolution for this advisory. Default: `\Foxy\Audit\CveStatus::NOT_REQUESTED`. | `AuditFinding` |
| <span id="property-dependencyPaths"></span>`$dependencyPaths` readonly constructor | `list<string>` | Dependency paths that include the vulnerable package. Default: `[]`. | `AuditFinding` |
| <span id="property-package"></span>`$package` readonly constructor | `string` | Package affected by the advisory. | `AuditFinding` |
| <span id="property-severity"></span>`$severity` readonly constructor | [`Severity`](/docs/extensions/foxy/reference/audit/severity/index.md) | Normalized advisory severity. | `AuditFinding` |
| <span id="property-sourceId"></span>`$sourceId` readonly constructor | `string\|null` | Identifier reported by the package manager. | `AuditFinding` |
| <span id="property-title"></span>`$title` readonly constructor | `string` | Human-readable advisory title. | `AuditFinding` |
| <span id="property-url"></span>`$url` readonly constructor | `string\|null` | Advisory details URL. Default: `null`. | `AuditFinding` |
| <span id="property-vulnerableVersions"></span>`$vulnerableVersions` readonly constructor | `string` | Version constraint reported as vulnerable. | `AuditFinding` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates an immutable audit finding. | `AuditFinding` |
| [`withCveResolution()`](#method-withCveResolution) | Returns a copy with the supplied CVE resolution. | `AuditFinding` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(string $package, Foxy\Audit\Severity $severity, string $advisoryId, string|null $sourceId, string $title, string $vulnerableVersions, string|null $url = null, list<string> $cves = [], Foxy\Audit\CveStatus $cveStatus = \Foxy\Audit\CveStatus::NOT_REQUESTED, list<string> $affectedVersions = [], list<string> $dependencyPaths = [])
```

Creates an immutable audit finding.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$package` | `string` | Package affected by the advisory. |
| `$severity` | [`Severity`](/docs/extensions/foxy/reference/audit/severity/index.md) | Normalized advisory severity. |
| `$advisoryId` | `string` | Preferred advisory identifier, such as a GHSA identifier. |
| `$sourceId` | `string\|null` | Identifier reported by the package manager. |
| `$title` | `string` | Human-readable advisory title. |
| `$vulnerableVersions` | `string` | Version constraint reported as vulnerable. |
| `$url` | `string\|null` | Advisory details URL. |
| `$cves` | `list<string>` | Associated CVE identifiers. |
| `$cveStatus` | [`CveStatus`](/docs/extensions/foxy/reference/audit/cvestatus/index.md) | Status of CVE resolution for this advisory. |
| `$affectedVersions` | `list<string>` | Installed versions affected by the advisory. |
| `$dependencyPaths` | `list<string>` | Dependency paths that include the vulnerable package. |

### withCveResolution() <span id="method-withCveResolution"></span>

```php
public function withCveResolution(list<string> $cves, Foxy\Audit\CveStatus $status): self
```

Returns a copy with the supplied CVE resolution.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$cves` | `list<string>` | Resolved CVE identifiers. |
| `$status` | [`CveStatus`](/docs/extensions/foxy/reference/audit/cvestatus/index.md) |  |

**Returns**

`self`