final class Helpers

Static helper class providing utility functions for working with assets.

Methods

static array
parseReference(string $qualifiedRef)

Splits a potentially qualified reference 'mapper:reference' into a [mapper, reference] array.

static void
checkOptions(array $array, array $optional = [], array $required = [])

Validates an array of options against allowed optional and required keys.

static float
guessMP3Duration(string $path)

Estimates the duration (in seconds) of an MP3 file, assuming constant bitrate (CBR).

Details

at line 21
static array parseReference(string $qualifiedRef)

Splits a potentially qualified reference 'mapper:reference' into a [mapper, reference] array.

Parameters

string $qualifiedRef

Return Value

array

at line 34
static void checkOptions(array $array, array $optional = [], array $required = [])

Validates an array of options against allowed optional and required keys.

Parameters

array $array
array $optional
array $required

Return Value

void

Exceptions

InvalidArgumentException

at line 49
static float guessMP3Duration(string $path)

Estimates the duration (in seconds) of an MP3 file, assuming constant bitrate (CBR).

Parameters

string $path

Return Value

float

Exceptions

RuntimeException

Traits

StaticClass