DiagnosticSource
class DiagnosticSource
Methods
Create a new diagnostic source instance.
Resolve the source metadata for the given diagnostic class.
Get the user-facing source label.
Resolve the source metadata for the given diagnostic class.
Resolve the file path for the given class.
Determine whether a diagnostic class belongs to the application.
Find the installed Composer package that contains a file.
Get the installation path for a Composer package.
Get the root Composer package name.
Get the file path relative to its package root.
Determine whether a directory contains a file.
Flush all static state.
Details
at line 22
__construct(string|null $package, string|null $file, string|null $relativeFile, bool $application)
Create a new diagnostic source instance.
at line 35
static DiagnosticSource
resolve(string $class)
Resolve the source metadata for the given diagnostic class.
at line 47
static DiagnosticSource
for(Diagnostic $diagnostic)
Resolve the source metadata for the given diagnostic instance.
at line 67
string
label()
Get the user-facing source label.
at line 77
static protected DiagnosticSource
resolveSource(string $class)
Resolve the source metadata for the given diagnostic class.
at line 106
static protected string|null
classFile(string $class)
Resolve the file path for the given class.
at line 128
static protected bool
isApplicationSource(string $class, string|null $package)
Determine whether a diagnostic class belongs to the application.
at line 142
static protected string|null
installedPackageForFile(string $file)
Find the installed Composer package that contains a file.
at line 178
static protected string|null
packagePath(string $package)
Get the installation path for a Composer package.
at line 198
static protected string|null
rootPackageName()
Get the root Composer package name.
at line 210
static protected string
relativePath(string $directory, string $file)
Get the file path relative to its package root.
at line 222
static protected bool
contains(string $directory, string $file)
Determine whether a directory contains a file.
at line 230
static void
flushState()
Flush all static state.