class ClassMapManager

Manages class map overrides applied to Composer's autoloader.

Allows packages to replace classes at the autoloader level, so the replacement file is loaded instead of the original. Entries are applied immediately when added and fail hard if the target class is already loaded.

Properties

static protected array<class-string, string> $entries

Methods

static void
add(array $map)

Add class map entries and apply them to the Composer autoloader.

static bool
hasEntries()

Determine if any class map entries have been registered.

static array
getEntries()

Get all registered class map entries.

static void
flushState()

Flush all static state.

Details

at line 36
static void add(array $map)

Add class map entries and apply them to the Composer autoloader.

Each entry maps an original class name to the path of its replacement file. Fails immediately if any target class is already loaded.

Boot-only. Class-map overrides mutate the worker's Composer autoloader and must be registered before any target class is autoloaded.

Parameters

array $map

Return Value

void

at line 55
static bool hasEntries()

Determine if any class map entries have been registered.

Return Value

bool

at line 65
static array getEntries()

Get all registered class map entries.

Return Value

array

at line 73
static void flushState()

Flush all static state.

Return Value

void