Skip to content
PHP Ecosystem
Explore

PruneCommand

API reference › Scaffold › Console › Command › PruneCommand

final classPHPForge\Scaffold\Console\Command\PruneCommand
ExtendsAbstractScaffoldCommand » Symfony\Component\Console\Command\Command
Sourcesrc/Console/Command/PruneCommand.php

Lists the files that no allowed provider ships anymore and, with --force, removes them from the lock and deletes the ones that hold only provider content.

MethodDescriptionDefined by
configure() protectedDeclares the --force, --delete-modified and --exit-code options.PruneCommand
execute() protected finalValidates the input, resolves the project root and runs AbstractScaffoldCommand::handle().AbstractScaffoldCommand
handle() protectedPreviews or prunes the orphaned entries.PruneCommand
validate() protectedReturns whether the input is valid, writing the error to the error output when it is not.AbstractScaffoldCommand
protected function configure(): void

Declares the --force, --delete-modified and --exit-code options.

protected function handle(Symfony\Component\Console\Input\InputInterface $input, PHPForge\Scaffold\Console\SymfonyOutputWriter $out, string $projectRoot): int

Previews or prunes the orphaned entries.

Parameters

ParameterTypeDescription
$inputSymfony\Component\Console\Input\InputInterfaceInput with the --force, --delete-modified and --exit-code options.
$outPHPForge\Scaffold\Console\SymfonyOutputWriterOutput sink that receives the orphan report and the error messages.
$projectRootstringAbsolute path of the project root.

Returns

int: Exit code of PruneService::run().