Implements the lifecycle of the Composer dev-tools extension framework.
Description
This plugin class MUST initialize and coordinate custom script registrations securely.
Interfaces
Properties
Methods
Handles activation lifecycle events for the Composer session.
Cleans up operations during Composer plugin deactivation events.
Resolves the implemented Composer capabilities structure.
Retrieves the comprehensive map of events this listener SHALL handle.
Detects whether a command name or alias is already registered in Composer's command surface.
Handles the automated script installation.
Handles final uninstallation processes logically.
Returns command names and aliases that DevTools plugin commands MUST NOT override.
Returns custom Composer script command names from the active root package.
Handles activation lifecycle events for the Composer session.
public
activate(Composer
$composer, IOInterface
$io) : void
Description
This method MUST adhere to the standard Composer plugin activation protocol, even if no specific logic is required.
Parameters
$composer
:
Composer
Description
the primary package configuration instance over Composer
$io
:
IOInterface
Description
interactive communication channels
Cleans up operations during Composer plugin deactivation events.
public
deactivate(Composer
$composer, IOInterface
$io) : void
Description
This method MUST implement the standard Composer lifecycle correctly, even if vacant.
Parameters
$composer
:
Composer
Description
the primary metadata controller object
$io
:
IOInterface
Description
defined interactions proxy
Resolves the implemented Composer capabilities structure.
public
getCapabilities() : array<string, string>
Description
This method MUST map the primary capability handlers to custom implementations. It SHALL describe how tools seamlessly integrate into the execution layer.
Return values
Description
the capability mapping configurations
Retrieves the comprehensive map of events this listener SHALL handle.
public
static
getSubscribedEvents() : array<string, string>
Description
This method MUST define the lifecycle triggers for script installation and synchronization during Composer package operations.
Return values
Description
the event mapping registry
Detects whether a command name or alias is already registered in Composer's command surface.
public
isRegisteredCommand(
string|null
$name) : bool
Parameters
$name
:
string|null
Description
the command name or alias being evaluated
Return values
Handles the automated script installation.
public
runSyncCommand(Event
$event) : void
Description
This method MUST execute the dev-tools:sync command after relevant Composer operations to ensure
the development tools are correctly synchronized with the current project state.
Parameters
$event
:
Event
Description
the Composer script event context
Handles final uninstallation processes logically.
public
uninstall(Composer
$composer, IOInterface
$io) : void
Description
This method MUST manage cleanup duties per Composer constraints, even if empty.
Parameters
$composer
:
Composer
Description
system package registry utility
$io
:
IOInterface
Description
execution runtime outputs and inputs proxy interface
Returns command names and aliases that DevTools plugin commands MUST NOT override.
private
getReservedCommandNames() : array<int, string>
Return values
Returns custom Composer script command names from the active root package.
private
getRootScriptCommandNames() : array<int, string>