Skip to content
PHP Ecosystem
Explore

ProvidersService

API reference › Scaffold › Services › ProvidersService

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

Lists scaffold providers recorded in scaffold-lock.json with their file counts.

MethodDescriptionDefined by
getProviders()Returns the number of tracked files of every provider recorded in scaffold-lock.json under $projectRoot.ProvidersService
run()Renders the providers table for the project rooted at $projectRoot.ProvidersService
public function getProviders(string $projectRoot): array<string, int>

Returns the number of tracked files of every provider recorded in scaffold-lock.json under $projectRoot.

Parameters

ParameterTypeDescription
$projectRootstringAbsolute path to the project root.

Returns

array<string, int>: Map of provider package names to the number of files tracked for them.

Throws

public function run(string $projectRoot, PHPForge\Scaffold\Console\OutputWriter $out): int

Renders the providers table for the project rooted at $projectRoot.

Parameters

ParameterTypeDescription
$projectRootstringAbsolute path to the project root directory.
$outPHPForge\Scaffold\Console\OutputWriterOutput sink used for stdout writes.

Returns

int: 0 on success.

Throws