Skip to content
PHP Ecosystem
Explore

EjectService

API reference › Scaffold › Services › EjectService

final classPHPForge\Scaffold\Services\EjectService
Sourcesrc/Services/EjectService.php

Marks a file entry as ejected in scaffold-lock.json so scaffold stops writing it; the file stays on disk.

MethodDescriptionDefined by
run()Marks the entry of $file as ejected, or only previews the change when $confirmed is false.EjectService
public function run(string $projectRoot, PHPForge\Scaffold\Console\OutputWriter $out, string $file, bool $confirmed = false): int

Marks the entry of $file as ejected, or only previews the change when $confirmed is false.

Parameters

ParameterTypeDescription
$projectRootstringAbsolute path to the project root.
$outPHPForge\Scaffold\Console\OutputWriterOutput sink.
$filestringDestination path as recorded in scaffold-lock.json.
$confirmedboolWhether to write the ejection; false only previews it.

Returns

int: 0 on success, including previews and entries already ejected; 1 when the entry is not tracked.

Throws