class ClassCollectionLoader

ClassCollectionLoader.

Methods

static 
load(array $classes, string $cacheDir, string $name, bool $autoReload, bool $adaptive = false, string $extension = '.php')

Loads a list of classes and caches them in one big file.

static string
fixNamespaceDeclarations(string $source)

Adds brackets around each namespace if it's not already the case.

static 
enableTokenizer($bool)

This method is only useful for testing.

Details

at line 37
static load(array $classes, string $cacheDir, string $name, bool $autoReload, bool $adaptive = false, string $extension = '.php')

Loads a list of classes and caches them in one big file.

Parameters

array $classes An array of classes to load
string $cacheDir A cache directory
string $name The cache name prefix
bool $autoReload Whether to flush the cache when the cache is stale or not
bool $adaptive Whether to remove already declared classes or not
string $extension File extension of the resulting file

Exceptions

InvalidArgumentException When class can't be loaded

at line 174
static string fixNamespaceDeclarations(string $source)

Adds brackets around each namespace if it's not already the case.

Parameters

string $source Namespace string

Return Value

string Namespaces with brackets

at line 247
static enableTokenizer($bool)

This method is only useful for testing.

Parameters

$bool