FOSSology  4.7.1
Open Source License Compliance by Open Source Software
Fossology\Lib\Data\Report\CycloneDxSettings Class Reference

CycloneDX export settings of a user (defaults) or of an upload. More...

Collaboration diagram for Fossology\Lib\Data\Report\CycloneDxSettings:
Collaboration graph

Public Member Functions

 __construct (bool $licenseComment=false, bool $ignoreFilesWithoutInfo=false, bool $osselotExport=false, ?string $tagNamespace=null, ?string $specVersion=null)
 
 toUserSettings ()
 
 toReportInfo ()
 
 isLicenseCommentEnabled ()
 
 isLicenseCommentChecked ()
 
 isIgnoreFilesWithoutInfo ()
 
 isOsselotExport ()
 
 getTagNamespace ()
 
 getSpecVersion ()
 

Static Public Member Functions

static normaliseNamespace (?string $namespace)
 
static normaliseSpecVersion (?string $version)
 
static fromUserSettings (?string $csv)
 
static fromReportInfo (?string $json)
 

Public Attributes

const SUPPORTED_VERSIONS = ['1.4', '1.5', '1.6', '1.7']
 
const DEFAULT_VERSION = '1.7'
 
const DEFAULT_NAMESPACE = 'fossology:'
 
const MAX_NAMESPACE_LENGTH = 64
 
const NAMESPACE_PATTERN = '/^[A-Za-z0-9._-]+(:[A-Za-z0-9._-]+)*:$/'
 

Static Private Member Functions

static flag (bool $value)
 

Private Attributes

 $licenseComment
 
 $ignoreFilesWithoutInfo
 
 $osselotExport
 
 $tagNamespace
 
 $specVersion
 

Detailed Description

CycloneDX export settings of a user (defaults) or of an upload.

users.cyclonedx_settings holds the CSV "osselot,comment,ignore[,namespace,specVersion]" (the last two are optional for rows written before they existed); report_info.ri_cyclonedx_selection holds the JSON produced by toReportInfo().

Definition at line 20 of file CycloneDxSettings.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\Lib\Data\Report\CycloneDxSettings::__construct ( bool  $licenseComment = false,
bool  $ignoreFilesWithoutInfo = false,
bool  $osselotExport = false,
?string  $tagNamespace = null,
?string  $specVersion = null 
)

Invalid namespace or version values fall back to the defaults.

Definition at line 43 of file CycloneDxSettings.php.

Member Function Documentation

◆ fromReportInfo()

static Fossology\Lib\Data\Report\CycloneDxSettings::fromReportInfo ( ?string  $json)
static
Parameters
string | null$jsonValue of report_info.ri_cyclonedx_selection
Returns
CycloneDxSettings|null Null when nothing usable is stored

Definition at line 108 of file CycloneDxSettings.php.

◆ fromUserSettings()

static Fossology\Lib\Data\Report\CycloneDxSettings::fromUserSettings ( ?string  $csv)
static
Parameters
string | null$csvValue of users.cyclonedx_settings
Returns
CycloneDxSettings

Definition at line 87 of file CycloneDxSettings.php.

◆ isLicenseCommentChecked()

Fossology\Lib\Data\Report\CycloneDxSettings::isLicenseCommentChecked ( )
Returns
bool The stored checkbox value, ignoring the OSSelot implication

Definition at line 146 of file CycloneDxSettings.php.

◆ isLicenseCommentEnabled()

Fossology\Lib\Data\Report\CycloneDxSettings::isLicenseCommentEnabled ( )
Returns
bool True if license comments go into the report. OSSelot export requires them.

Definition at line 138 of file CycloneDxSettings.php.

◆ normaliseNamespace()

static Fossology\Lib\Data\Report\CycloneDxSettings::normaliseNamespace ( ?string  $namespace)
static
Parameters
string | null$namespaceUser input, with or without the trailing colon
Returns
string|null The namespace ending in ':', or null if not acceptable

Definition at line 58 of file CycloneDxSettings.php.

◆ normaliseSpecVersion()

static Fossology\Lib\Data\Report\CycloneDxSettings::normaliseSpecVersion ( ?string  $version)
static
Parameters
string | null$version
Returns
string|null The version if supported, else null

Definition at line 78 of file CycloneDxSettings.php.

◆ toReportInfo()

Fossology\Lib\Data\Report\CycloneDxSettings::toReportInfo ( )
Returns
string Value for report_info.ri_cyclonedx_selection

Definition at line 123 of file CycloneDxSettings.php.

◆ toUserSettings()

Fossology\Lib\Data\Report\CycloneDxSettings::toUserSettings ( )
Returns
string Value for users.cyclonedx_settings

Definition at line 97 of file CycloneDxSettings.php.

Member Data Documentation

◆ NAMESPACE_PATTERN

const Fossology\Lib\Data\Report\CycloneDxSettings::NAMESPACE_PATTERN = '/^[A-Za-z0-9._-]+(:[A-Za-z0-9._-]+)*:$/'

Colon-separated segments ending in a colon; never contains a comma.

Definition at line 27 of file CycloneDxSettings.php.


The documentation for this class was generated from the following file: