Skip to content

API

The plugin provides a slim API which can be used to unregister currently registered services or to register new services.

Registry::registerService()

Tip

Learn how to create a custom service if you want to register it here.

Registers the given service class in the Registry so that it can be used by the Reporter. It is required that the given service class implements the ServiceInterface.

Parameter Description
string $className The class name of a service to be registered within the registry.

Example:

Registry::registerService(\My\Vendor\Service\MyService::class);

Registry::unregisterService()

Removes the given service class from the list of registered services in the Registry.

Parameter Description
string $className The class name of a service to be removed from the registry.

Example:

Registry::unregisterService(\My\Vendor\Service\MyService::class);

Registry::getServices()

Returns the list of currently registered services in the Registry.

Example:

$services = Registry::getServices();

Reporter::report()

Reports the given UpdateCheckResult to all currently registered services.

Parameter Description
UpdateCheckResult $result The scan results to be reported to all currently registered services.

Example:

$reporter = new Reporter($composer);
$reporter->report($result);