Skip to content
github-actions edited this page Mar 26, 2026 · 5 revisions

Implements the lifecycle of the Composer dev-tools extension framework.

This plugin class MUST initialize and coordinate custom script registrations securely.


  • Full name: \FastForward\DevTools\Composer\Plugin
  • This class is marked as final and can't be subclassed
  • This class implements: Capable, EventSubscriberInterface, PluginInterface
  • This class is a Final class

Methods

getCapabilities

Resolves the implemented Composer capabilities structure.

public getCapabilities(): array<string,string>

This method MUST map the primary capability handlers to custom implementations. It SHALL describe how tools seamlessly integrate into the execution layer.

Return Value:

the capability mapping configurations


getSubscribedEvents

Retrieves the comprehensive map of events this listener SHALL handle.

public static getSubscribedEvents(): array<string,string>

This method MUST define the lifecycle triggers for script installation and synchronization during Composer package operations.

  • This method is static. Return Value:

the event mapping registry


onPostInstall

Handles the automated script installation.

public onPostInstall(\Composer\Script\Event $event): void

This method MUST be triggered by POST_INSTALL_CMD and SHALL delegate the actual work to the installScripts utility.

Parameters:

Parameter Type Description
$event \Composer\Script\Event the Composer script event context

onPostUpdate

Handles the automated script synchronization after updates.

public onPostUpdate(\Composer\Script\Event $event): void

This method MUST be triggered by POST_UPDATE_CMD and SHALL ensure that all development scripts are correctly aligned in the root configuration.

Parameters:

Parameter Type Description
$event \Composer\Script\Event the Composer script event context

activate

Handles activation lifecycle events for the Composer session.

public activate(\Composer\Composer $composer, \Composer\IO\IOInterface $io): void

The method MUST ensure the dev-tools script capability exists inside composer.json extras. It SHOULD append it if currently missing.

Parameters:

Parameter Type Description
$composer \Composer\Composer the primary package configuration instance over Composer
$io \Composer\IO\IOInterface interactive communication channels

deactivate

Cleans up operations during Composer plugin deactivation events.

public deactivate(\Composer\Composer $composer, \Composer\IO\IOInterface $io): void

This method MUST implement the standard Composer lifecycle correctly, even if vacant.

Parameters:

Parameter Type Description
$composer \Composer\Composer the primary metadata controller object
$io \Composer\IO\IOInterface defined interactions proxy

uninstall

Handles final uninstallation processes logically.

public uninstall(\Composer\Composer $composer, \Composer\IO\IOInterface $io): void

This method MUST manage cleanup duties per Composer constraints, even if empty.

Parameters:

Parameter Type Description
$composer \Composer\Composer system package registry utility
$io \Composer\IO\IOInterface execution runtime outputs and inputs proxy interface

Clone this wiki locally