class DebugClassLoader

Autoloader checking if the class is really defined in the file found.

The ClassLoader will wrap all registered autoloaders and will throw an exception if a file is found but does not declare the class.

Methods

__construct(callable|object $classLoader)

No description

callable|object
getClassLoader()

Gets the wrapped class loader.

static 
enable()

Wraps all autoloaders.

static 
disable()

Disables the wrapping.

string|null
findFile(string $class) deprecated

Finds a file by class name.

bool|null
loadClass(string $class)

Loads the given class or interface.

Details

at line 39
__construct(callable|object $classLoader)

Parameters

callable|object $classLoader Passing an object is @deprecated since version 2.5 and support for it will be removed in 3.0

at line 81
callable|object getClassLoader()

Gets the wrapped class loader.

Return Value

callable|object A class loader. Since version 2.5, returning an object is @deprecated and support for it will be removed in 3.0

at line 89
static enable()

Wraps all autoloaders.

at line 115
static disable()

Disables the wrapping.

at line 143
string|null findFile(string $class) deprecated

deprecated since version 2.5, to be removed in 3.0.

Finds a file by class name.

Parameters

string $class A class name to resolve to file

Return Value

string|null

at line 161
bool|null loadClass(string $class)

Loads the given class or interface.

Parameters

string $class The name of the class

Return Value

bool|null True, if loaded

Exceptions

RuntimeException