FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\SpdxTwo\SpdxTwoUtils Class Reference

Utilities for SPDX2. More...

Collaboration diagram for Fossology\SpdxTwo\SpdxTwoUtils:
Collaboration graph

Static Public Member Functions

static preWorkOnArgsFlp ($args, $key1, $key2)
 For a given set of arguments assign $args[$key1] and $args[$key2]. More...
 
static addPrefixOnDemand ($license)
 Add prefix to the license based on SPDX2 standards. More...
 
static addPrefixOnDemandKeys ($licenses)
 Add prefix to license keys. More...
 
static addPrefixOnDemandList ($licenses)
 Add prefix to license list. More...
 
static implodeLicenses ($licenses)
 Implode licenses with "AND" or "OR". More...
 
static cleanTextArray ($texts)
 
static removeEmptyLicenses ($licenses)
 

Detailed Description

Utilities for SPDX2.

Definition at line 16 of file spdx2utils.php.

Member Function Documentation

◆ addPrefixOnDemand()

static Fossology\SpdxTwo\SpdxTwoUtils::addPrefixOnDemand (   $license)
static

Add prefix to the license based on SPDX2 standards.

Parameters
string$license
Returns
string

Definition at line 46 of file spdx2utils.php.

◆ addPrefixOnDemandKeys()

static Fossology\SpdxTwo\SpdxTwoUtils::addPrefixOnDemandKeys (   $licenses)
static

Add prefix to license keys.

Parameters
array$licenses
Returns
string[]

Definition at line 69 of file spdx2utils.php.

◆ addPrefixOnDemandList()

static Fossology\SpdxTwo\SpdxTwoUtils::addPrefixOnDemandList (   $licenses)
static

Add prefix to license list.

Parameters
array$licenses
Returns
array

Definition at line 83 of file spdx2utils.php.

◆ cleanTextArray()

static Fossology\SpdxTwo\SpdxTwoUtils::cleanTextArray (   $texts)
static

Clean an array of strings by trimming the elements and removing empty strings.

Parameters
string[]$textsArray of texts to be concatenated.
Returns
string[] String array with all trimmed string elements.

Definition at line 123 of file spdx2utils.php.

◆ implodeLicenses()

static Fossology\SpdxTwo\SpdxTwoUtils::implodeLicenses (   $licenses)
static

Implode licenses with "AND" or "OR".

Parameters
string[]$licenses
Returns
string

Definition at line 96 of file spdx2utils.php.

◆ preWorkOnArgsFlp()

static Fossology\SpdxTwo\SpdxTwoUtils::preWorkOnArgsFlp (   $args,
  $key1,
  $key2 
)
static

For a given set of arguments assign $args[$key1] and $args[$key2].

Get the array of arguments and find $key1 and $key2 values and assign to $args[$key1] and $args[$key2].

Parameters
string[]$argsString array
string$key1Key1
string$key2Key2
Returns
string[] $args

Definition at line 28 of file spdx2utils.php.

◆ removeEmptyLicenses()

static Fossology\SpdxTwo\SpdxTwoUtils::removeEmptyLicenses (   $licenses)
static

Remove empty and 'NOASSERTION' licenses from list.

Parameters
string[]$licensesList of licenses.
Returns
array List of licenses removing empty and 'NOASSERTION's.

Definition at line 147 of file spdx2utils.php.


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