ClassNotFoundErrorEnhancer
in package
implements
ErrorEnhancerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- enhance() : Throwable|null
- Returns an \Throwable instance if the class is able to improve the error, null otherwise.
- classExists() : bool
- convertFileToClass() : string|null
- findClassInPath() : array<string|int, mixed>
- getClassCandidates() : array<string|int, mixed>
- Tries to guess the full namespace for a given class name.
Methods
enhance()
Returns an \Throwable instance if the class is able to improve the error, null otherwise.
public
enhance(Throwable $error) : Throwable|null
Parameters
- $error : Throwable
Return values
Throwable|null —classExists()
private
classExists(string $class) : bool
Parameters
- $class : string
Return values
bool —convertFileToClass()
private
convertFileToClass(string $path, string $file, string $prefix) : string|null
Parameters
- $path : string
- $file : string
- $prefix : string
Return values
string|null —findClassInPath()
private
findClassInPath(string $path, string $class, string $prefix) : array<string|int, mixed>
Parameters
- $path : string
- $class : string
- $prefix : string
Return values
array<string|int, mixed> —getClassCandidates()
Tries to guess the full namespace for a given class name.
private
getClassCandidates(string $class) : array<string|int, mixed>
By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer autoloader (that should cover all common cases).
Parameters
- $class : string
-
A class name (without its namespace)