CycloneDX Library

Bom
in package

Tags
author

nscuro

author

jkowalleck

Table of Contents

Properties

$components  : ComponentRepository
$externalReferences  : ExternalReferenceRepository
Provides the ability to document external references related to the BOM or to the project the BOM describes.
$metadata  : Metadata
$properties  : PropertyRepository
Provides the ability to document properties in a key/value store.
$serialNumber  : string|null
Every BOM generated SHOULD have a unique serial number, even if the contents of the BOM have not changed over time.
$version  : int
The version allows component publishers/authors to make changes to existing BOMs to update various aspects of the document such as description or licenses.

Methods

__construct()  : mixed
getComponents()  : ComponentRepository
getExternalReferences()  : ExternalReferenceRepository
getMetadata()  : Metadata
getProperties()  : PropertyRepository
getSerialNumber()  : string|null
getVersion()  : int
setComponents()  : $this
setExternalReferences()  : $this
setMetadata()  : $this
setProperties()  : $this
setSerialNumber()  : $this
Create valid values with {@see \CycloneDX\Core\Utils\BomUtility::randomSerialNumber()}.
setVersion()  : $this
isValidVersion()  : bool

Properties

$externalReferences

Provides the ability to document external references related to the BOM or to the project the BOM describes.

private ExternalReferenceRepository $externalReferences

$properties

Provides the ability to document properties in a key/value store.

private PropertyRepository $properties

This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions.

Property names of interest to the general public are encouraged to be registered in the CycloneDX Property Taxonomy. Formal registration is OPTIONAL.

$serialNumber

Every BOM generated SHOULD have a unique serial number, even if the contents of the BOM have not changed over time.

private string|null $serialNumber = null

If specified, the serial number MUST conform to RFC-4122. Use of serial numbers are RECOMMENDED.

  • pattern for XSD: urn:uuid:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|({[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}})
  • pattern for JSON: ^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Tags
psalm-var

non-empty-string|null

$version

The version allows component publishers/authors to make changes to existing BOMs to update various aspects of the document such as description or licenses.

private int $version = 1

When a system is presented with multiple BOMs for the same component, the system should use the most recent version of the BOM. The default version is '1' and should be incremented for each version of the BOM that is published. Each version of a component should have a unique BOM and if no changes are made to the BOMs, then each BOM will have a version of '1'.

Tags
psalm-var

positive-int

Methods

__construct()

public __construct() : mixed

getSerialNumber()

public getSerialNumber() : string|null
Tags
psalm-return

non-empty-string|null

Return values
string|null

getVersion()

public getVersion() : int
Tags
psalm-return

positive-int

Return values
int

setMetadata()

public setMetadata(Metadata $metadata) : $this
Parameters
$metadata : Metadata
Return values
$this

setSerialNumber()

Create valid values with {@see \CycloneDX\Core\Utils\BomUtility::randomSerialNumber()}.

public setSerialNumber(string|null $serialNumber) : $this
Parameters
$serialNumber : string|null
Return values
$this

setVersion()

public setVersion(int $version) : $this
Parameters
$version : int

a value >= 1

Tags
psalm-assert

positive-int $version

throws
DomainException

if version <= 0

Return values
$this

isValidVersion()

private static isValidVersion(int $version) : bool
Parameters
$version : int
Tags
psalm-pure
psalm-assert-if-true

positive-int $version

Return values
bool

        
On this page

Search results