EventSubscriber
API reference › Scaffold › EventSubscriber
Listens to Composer script events and triggers the scaffold workflow.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getSubscribedEvents() static | Returns 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 |
Method details
Section titled “Method details”getSubscribedEvents()
Section titled “getSubscribedEvents() ”public static function getSubscribedEvents(): array<string, string>Returns the Composer script events handled by this subscriber.
Returns
array<string, string>: Event name => handler method.
onPostCreateProject()
Section titled “onPostCreateProject() ”public function onPostCreateProject(Composer\Script\Event $event): voidRuns the scaffold workflow for post-create-project-cmd, unless post-install-cmd or post-update-cmd already
fired in this process.
Parameters
| Parameter | Type | Description |
|---|---|---|
$event | Composer\ | The Composer event object. |
onPostInstall()
Section titled “onPostInstall() ”public function onPostInstall(Composer\Script\Event $event): voidRuns the scaffold workflow for post-install-cmd.
Parameters
| Parameter | Type | Description |
|---|---|---|
$event | Composer\ | The Composer event object. |
onPostUpdate()
Section titled “onPostUpdate() ”public function onPostUpdate(Composer\Script\Event $event): voidRuns the scaffold workflow for post-update-cmd.
Parameters
| Parameter | Type | Description |
|---|---|---|
$event | Composer\ | The Composer event object. |