Documentation

PackageProbe
in package

Read onlyYes
FinalYes

A package's declaration to the boot report.

Holds only names, never instances, so declaring a probe loads nothing and boots nothing: the report resolves the classes when it is collected. The built-in checks it drives are:

  • autoload: the entry class (or the kernel class when no entry class is given) resolves through the autoloader, and from which file. A class file alone does not tell which vendor/autoload.php was loaded, so a package whose bootstrap chooses between autoloaders (its own vendor/ or a shared one) passes the chosen path as autoloaderPath; the check reports it and fails when that file does not exist;
  • kernel: the kernel subclass reports Kernel::isBooted() (read-only: it never boots the kernel);
  • version: the package declared a version.

Any further DiagnosticCheckInterface runs after them, in order.

Example (main plugin file, right after the autoloader, before the kernel boots, so a failed boot is still reported):

(new DiagnosticsRegistry('acme_diagnostics'))->register(new PackageProbe(
    name: 'acme-shop',
    version: ACME_SHOP_VERSION,
    kernelClass: AcmeShopKernel::class,
));

Table of Contents

Properties

$autoloaderPath  : string|null
$checks  : array<string|int, mixed>
$entryClass  : string|null
$kernelClass  : string|null
$name  : string
$version  : string

Methods

__construct()  : mixed
autoloadClass()  : string|null
The class the autoload check resolves, or null when none was declared.

Properties

$autoloaderPath

public string|null $autoloaderPath = null

Methods

__construct()

public __construct(string $name[, string $version = '' ][, null|Kernel> $kernelClass = null ][, null|class-string $entryClass = null ][, array<int, DiagnosticCheckInterface> $checks = [] ][, null|string $autoloaderPath = null ]) : mixed
Parameters
$name : string

stable package identifier, matched by the command's expected-package list

$version : string = ''

declared package version; empty is a warning

$kernelClass : null|Kernel> = null

the package's kernel subclass, when it has one

$entryClass : null|class-string = null

class proving the autoloader resolved the package; defaults to the kernel class

$checks : array<int, DiagnosticCheckInterface> = []

further package or host checks

$autoloaderPath : null|string = null

the autoload.php the package's bootstrap required, when it chooses between several

Tags
throws
InvalidArgumentException

when the name is empty

autoloadClass()

The class the autoload check resolves, or null when none was declared.

public autoloadClass() : string|null
Return values
string|null
On this page

Search results