Skip to content
PHP Ecosystem
Explore

EjectCommand

API reference › Scaffold › Console › Command › EjectCommand

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

Marks a file as ejected in scaffold-lock.json so scaffold stops managing it, without deleting it from disk.

MethodDescriptionDefined by
configure() protectedDeclares the file argument and the --yes option.EjectCommand
execute() protected finalValidates the input, resolves the project root and runs AbstractScaffoldCommand::handle().AbstractScaffoldCommand
handle() protectedEjects the given file, or previews the ejection without --yes.EjectCommand
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 file argument and the --yes option.

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

Ejects the given file, or previews the ejection without --yes.

Parameters

ParameterTypeDescription
$inputSymfony\Component\Console\Input\InputInterfaceInput with the file argument and the --yes option.
$outPHPForge\Scaffold\Console\SymfonyOutputWriterOutput sink that receives the ejection notice and the error messages.
$projectRootstringAbsolute path of the project root.

Returns

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