Skip to content
PHP Ecosystem
Explore

Plugin

API reference › Scaffold › Plugin

final classPHPForge\Scaffold\Plugin
ImplementsComposer\Plugin\PluginInterface
Sourcesrc/Plugin.php

Registers the EventSubscriber that scaffolds provider files after composer install, composer update and composer create-project.

MethodDescriptionDefined by
activate()Creates the event subscriber and registers it with Composer’s event dispatcher.Plugin
deactivate()Removes the registered event subscriber from Composer’s event dispatcher.Plugin
uninstall()Performs no cleanup; scaffolded files and scaffold-lock.json stay in the project.Plugin
public function activate(Composer\Composer $composer, Composer\IO\IOInterface $io): void

Creates the event subscriber and registers it with Composer’s event dispatcher.

Parameters

ParameterTypeDescription
$composerComposer\ComposerComposer instance whose event dispatcher receives the subscriber.
$ioComposer\IO\IOInterfaceComposer IO; unused.
public function deactivate(Composer\Composer $composer, Composer\IO\IOInterface $io): void

Removes the registered event subscriber from Composer’s event dispatcher.

Parameters

ParameterTypeDescription
$composerComposer\ComposerComposer instance whose event dispatcher holds the subscriber.
$ioComposer\IO\IOInterfaceComposer IO; unused.
public function uninstall(Composer\Composer $composer, Composer\IO\IOInterface $io): void

Performs no cleanup; scaffolded files and scaffold-lock.json stay in the project.

Parameters

ParameterTypeDescription
$composerComposer\ComposerComposer instance; unused.
$ioComposer\IO\IOInterfaceComposer IO; unused.