REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 3.78 KB
Close
/opt/cpanel/ea-wappspector/vendor/rector/rector/src/Console/ConsoleApplication.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\Console; use RectorPrefix202411\Composer\XdebugHandler\XdebugHandler; use Rector\Application\VersionResolver; use Rector\ChangesReporting\Output\ConsoleOutputFormatter; use Rector\Configuration\Option; use RectorPrefix202411\Symfony\Component\Console\Application; use RectorPrefix202411\Symfony\Component\Console\Command\Command; use RectorPrefix202411\Symfony\Component\Console\Input\InputDefinition; use RectorPrefix202411\Symfony\Component\Console\Input\InputInterface; use RectorPrefix202411\Symfony\Component\Console\Input\InputOption; use RectorPrefix202411\Symfony\Component\Console\Output\OutputInterface; use RectorPrefix202411\Webmozart\Assert\Assert; final class ConsoleApplication extends Application { /** * @var string */ private const NAME = 'Rector'; /** * @param Command[] $commands */ public function __construct(array $commands) { parent::__construct(self::NAME, VersionResolver::PACKAGE_VERSION); Assert::notEmpty($commands); Assert::allIsInstanceOf($commands, Command::class); $this->addCommands($commands); // run this command, if no command name is provided $this->setDefaultCommand('process'); } public function doRun(InputInterface $input, OutputInterface $output) : int { $isXdebugAllowed = $input->hasParameterOption('--xdebug'); if (!$isXdebugAllowed) { $xdebugHandler = new XdebugHandler('rector'); $xdebugHandler->setPersistent(); $xdebugHandler->check(); unset($xdebugHandler); } $shouldFollowByNewline = \false; // skip in this case, since generate content must be clear from meta-info if ($this->shouldPrintMetaInformation($input)) { $output->writeln($this->getLongVersion()); $shouldFollowByNewline = \true; } if ($shouldFollowByNewline) { $output->write(\PHP_EOL); } return parent::doRun($input, $output); } protected function getDefaultInputDefinition() : InputDefinition { $defaultInputDefinition = parent::getDefaultInputDefinition(); $this->removeUnusedOptions($defaultInputDefinition); $this->addCustomOptions($defaultInputDefinition); return $defaultInputDefinition; } private function shouldPrintMetaInformation(InputInterface $input) : bool { $hasNoArguments = $input->getFirstArgument() === null; if ($hasNoArguments) { return \false; } $hasVersionOption = $input->hasParameterOption('--version'); if ($hasVersionOption) { return \false; } $outputFormat = $input->getParameterOption(['-o', '--output-format']); return $outputFormat === ConsoleOutputFormatter::NAME; } private function removeUnusedOptions(InputDefinition $inputDefinition) : void { $options = $inputDefinition->getOptions(); unset($options['quiet'], $options['no-interaction']); $inputDefinition->setOptions($options); } private function addCustomOptions(InputDefinition $inputDefinition) : void { $inputDefinition->addOption(new InputOption(Option::CONFIG, 'c', InputOption::VALUE_REQUIRED, 'Path to config file', $this->getDefaultConfigPath())); $inputDefinition->addOption(new InputOption(Option::DEBUG, null, InputOption::VALUE_NONE, 'Enable debug verbosity (-vvv)')); $inputDefinition->addOption(new InputOption(Option::XDEBUG, null, InputOption::VALUE_NONE, 'Allow running xdebug')); $inputDefinition->addOption(new InputOption(Option::CLEAR_CACHE, null, InputOption::VALUE_NONE, 'Clear cache')); } private function getDefaultConfigPath() : string { return \getcwd() . '/rector.php'; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 4 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Command
DIR
-
drwxr-xr-x
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Formatter
DIR
-
drwxr-xr-x
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Output
DIR
-
drwxr-xr-x
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Style
DIR
-
drwxr-xr-x
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ConsoleApplication.php
3.78 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ExitCode.php
388 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Notifier.php
1.23 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProcessConfigureDecorator.php
1.91 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).