StatusService
API reference › Scaffold › Services › StatusService
Reports the state of each file tracked in scaffold-lock.json against the disk and the current provider stubs, and
the provider files not tracked yet as pending.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
run() | Renders the status of all files tracked in scaffold-lock.json of the project, as a table followed by a summary line or as a JSON document, with notices and provider version drift on stderr. | StatusService |
Method details
Section titled “Method details”run()
Section titled “run() ”public function run(PHPForge\Scaffold\Config\ProjectContext $context, PHPForge\Scaffold\Console\OutputWriter $out, bool $json = false, bool $exitCode = false): intRenders the status of all files tracked in scaffold-lock.json of the project, as a table followed by a
summary line or as a JSON document, with notices and provider version drift on stderr.
Parameters
| Parameter | Type | Description |
|---|---|---|
$context | PHPForge\ | Project to inspect. |
$out | PHPForge\ | Output sink. |
$json | bool | Whether to print only the JSON document on stdout. |
$exitCode | bool | Whether to return 1 when any file is neither synced nor ejected, pending included. |
Returns
int: 1 when any file is in the error state, or with $exitCode when any file is neither synced nor ejected; 0 otherwise.
Throws
RuntimeException: when the lock file cannot be read or the JSON document cannot be encoded.