-
-
Notifications
You must be signed in to change notification settings - Fork 440
Expand file tree
/
Copy pathProcessConfigureDecorator.php
More file actions
85 lines (70 loc) · 2.75 KB
/
ProcessConfigureDecorator.php
File metadata and controls
85 lines (70 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
declare(strict_types=1);
namespace Rector\Console;
use Rector\ChangesReporting\Output\ConsoleOutputFormatter;
use Rector\Configuration\Option;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
final class ProcessConfigureDecorator
{
public static function decorate(Command $command): void
{
$command->addArgument(
Option::SOURCE,
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
'Files or directories to be upgraded.'
);
$command->addOption(
Option::DRY_RUN,
Option::DRY_RUN_SHORT,
InputOption::VALUE_NONE,
'Only see the diff of changes, do not save them to files.'
);
$command->addOption(
Option::AUTOLOAD_FILE,
Option::AUTOLOAD_FILE_SHORT,
InputOption::VALUE_REQUIRED,
'Path to file with extra autoload (will be included)'
);
$command->addOption(
Option::NO_PROGRESS_BAR,
null,
InputOption::VALUE_NONE,
'Hide progress bar. Useful e.g. for nicer CI output.'
);
$command->addOption(
Option::NO_DIFFS,
null,
InputOption::VALUE_NONE,
'Hide diffs of changed files. Useful e.g. for nicer CI output.'
);
$command->addOption(
Option::OUTPUT_FORMAT,
null,
InputOption::VALUE_REQUIRED,
'Select output format',
ConsoleOutputFormatter::NAME
);
// filter by rule and path
$command->addOption(Option::ONLY, null, InputOption::VALUE_REQUIRED, 'Fully qualified rule class name');
$command->addOption(
Option::ONLY_SUFFIX,
null,
InputOption::VALUE_REQUIRED,
'Filter only files with specific suffix in name, e.g. "Controller"'
);
$command->addOption(Option::DEBUG, null, InputOption::VALUE_NONE, 'Display debug output.');
$command->addOption(Option::MEMORY_LIMIT, null, InputOption::VALUE_REQUIRED, 'Memory limit for process');
$command->addOption(Option::CLEAR_CACHE, null, InputOption::VALUE_NONE, 'Clear unchanged files cache');
$command->addOption(Option::PARALLEL_PORT, null, InputOption::VALUE_REQUIRED);
$command->addOption(Option::PARALLEL_IDENTIFIER, null, InputOption::VALUE_REQUIRED);
$command->addOption(Option::XDEBUG, null, InputOption::VALUE_NONE, 'Display xdebug output.');
$command->addOption(
Option::RULES_SUMMARY,
null,
InputOption::VALUE_NONE,
'Show summary of rules applied during the run.'
);
}
}