Skip to content
PHP Ecosystem
Explore

StatusService

API reference › Scaffold › Services › StatusService

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

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.

MethodDescriptionDefined 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
public function run(PHPForge\Scaffold\Config\ProjectContext $context, PHPForge\Scaffold\Console\OutputWriter $out, bool $json = false, bool $exitCode = false): int

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.

Parameters

ParameterTypeDescription
$contextPHPForge\Scaffold\Config\ProjectContextProject to inspect.
$outPHPForge\Scaffold\Console\OutputWriterOutput sink.
$jsonboolWhether to print only the JSON document on stdout.
$exitCodeboolWhether 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.