Skip to content
PHP Ecosystem
Explore

EventSubscriber

API reference › Scaffold › EventSubscriber

final classPHPForge\Scaffold\EventSubscriber
ImplementsComposer\EventDispatcher\EventSubscriberInterface
Sourcesrc/EventSubscriber.php

Listens to Composer script events and triggers the scaffold workflow.

MethodDescriptionDefined by
getSubscribedEvents() staticReturns the Composer script events handled by this subscriber.EventSubscriber
onPostCreateProject()Runs the scaffold workflow for post-create-project-cmd, unless post-install-cmd or post-update-cmd already fired in this process.EventSubscriber
onPostInstall()Runs the scaffold workflow for post-install-cmd.EventSubscriber
onPostUpdate()Runs the scaffold workflow for post-update-cmd.EventSubscriber
public static function getSubscribedEvents(): array<string, string>

Returns the Composer script events handled by this subscriber.

Returns

array<string, string>: Event name => handler method.

public function onPostCreateProject(Composer\Script\Event $event): void

Runs the scaffold workflow for post-create-project-cmd, unless post-install-cmd or post-update-cmd already fired in this process.

Parameters

ParameterTypeDescription
$eventComposer\Script\EventThe Composer event object.
public function onPostInstall(Composer\Script\Event $event): void

Runs the scaffold workflow for post-install-cmd.

Parameters

ParameterTypeDescription
$eventComposer\Script\EventThe Composer event object.
public function onPostUpdate(Composer\Script\Event $event): void

Runs the scaffold workflow for post-update-cmd.

Parameters

ParameterTypeDescription
$eventComposer\Script\EventThe Composer event object.