EjectService
API reference › Scaffold › Services › EjectService
Marks a file entry as ejected in scaffold-lock.json so scaffold stops writing it; the file stays on disk.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
run() | Marks the entry of $file as ejected, or only previews the change when $confirmed is false. | EjectService |
Method details
Section titled “Method details”run()
Section titled “run() ”public function run(string $projectRoot, PHPForge\Scaffold\Console\OutputWriter $out, string $file, bool $confirmed = false): intMarks the entry of $file as ejected, or only previews the change when $confirmed is false.
Parameters
| Parameter | Type | Description |
|---|---|---|
$projectRoot | string | Absolute path to the project root. |
$out | PHPForge\ | Output sink. |
$file | string | Destination path as recorded in scaffold-lock.json. |
$confirmed | bool | Whether 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
RuntimeException: when the lock file cannot be read or written.